use of io.netty.handler.codec.compression.Lz4FrameDecoder in project Terasology by MovingBlocks.
the class TerasologyClientPipelineFactory method initChannel.
@Override
protected void initChannel(Channel ch) throws Exception {
JoinStatusImpl joinStatus = new JoinStatusImpl();
ChannelPipeline p = ch.pipeline();
p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
p.addLast("inflateDecoder", new Lz4FrameDecoder());
p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
p.addLast("deflateEncoder", new Lz4FrameEncoder(true));
p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("authenticationHandler", new ClientHandshakeHandler(joinStatus));
p.addLast("connectionHandler", new ClientConnectionHandler(joinStatus, networkSystem));
p.addLast("handler", new ClientHandler(networkSystem));
}
use of io.netty.handler.codec.compression.Lz4FrameDecoder in project Terasology by MovingBlocks.
the class InfoRequestPipelineFactory method initChannel.
@Override
protected void initChannel(Channel ch) throws Exception {
JoinStatusImpl joinStatus = new JoinStatusImpl();
ChannelPipeline p = ch.pipeline();
p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
p.addLast("inflateDecoder", new Lz4FrameDecoder());
p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
p.addLast("deflateEncoder", new Lz4FrameEncoder(true));
p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("authenticationHandler", new ClientHandshakeHandler(joinStatus));
p.addLast("connectionHandler", new ServerInfoRequestHandler());
}
use of io.netty.handler.codec.compression.Lz4FrameDecoder in project Terasology by MovingBlocks.
the class TerasologyServerPipelineFactory method initChannel.
@Override
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
p.addLast("inflateDecoder", new Lz4FrameDecoder());
p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
p.addLast("deflateEncoder", new Lz4FrameEncoder(true));
p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("authenticationHandler", new ServerHandshakeHandler());
p.addLast("connectionHandler", new ServerConnectionHandler(networkSystem));
p.addLast("handler", new ServerHandler(networkSystem));
}
Aggregations