use of de.jackwhite20.japs.shared.pipeline.handler.JSONObjectDecoder in project JaPS by JackWhite20.
the class ClusterPublisherChannelInitializer method initChannel.
@Override
protected void initChannel(Channel channel) throws Exception {
try {
channel.config().setOption(ChannelOption.IP_TOS, 0x18);
} catch (ChannelException e) {
// Not supported
}
channel.config().setAllocator(PooledByteBufAllocator.DEFAULT);
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4));
channel.pipeline().addLast(new JSONObjectDecoder());
channel.pipeline().addLast(new LengthFieldPrepender(4));
channel.pipeline().addLast(new JSONObjectEncoder());
channel.pipeline().addLast(clusterPublisher);
}
use of de.jackwhite20.japs.shared.pipeline.handler.JSONObjectDecoder in project JaPS by JackWhite20.
the class ServerChannelInitializer method initChannel.
@Override
protected void initChannel(Channel channel) throws Exception {
try {
channel.config().setOption(ChannelOption.IP_TOS, 0x18);
} catch (ChannelException e) {
// Not supported
}
channel.config().setAllocator(PooledByteBufAllocator.DEFAULT);
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4));
channel.pipeline().addLast(new JSONObjectDecoder());
channel.pipeline().addLast(new LengthFieldPrepender(4));
channel.pipeline().addLast(new JSONObjectEncoder());
channel.pipeline().addLast(new Connection(jaPSServer, channel));
}
use of de.jackwhite20.japs.shared.pipeline.handler.JSONObjectDecoder in project JaPS by JackWhite20.
the class ClientChannelInitializer method initChannel.
@Override
protected void initChannel(Channel channel) throws Exception {
try {
channel.config().setOption(ChannelOption.IP_TOS, 0x18);
} catch (ChannelException e) {
// Not supported
}
channel.config().setAllocator(PooledByteBufAllocator.DEFAULT);
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4));
channel.pipeline().addLast(new JSONObjectDecoder());
channel.pipeline().addLast(new LengthFieldPrepender(4));
channel.pipeline().addLast(new JSONObjectEncoder());
channel.pipeline().addLast(nioSocketClient);
}
Aggregations