use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project traccar by traccar.
the class CastelProtocol method initTrackerServers.
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 2, 2, -4, 0));
pipeline.addLast("objectEncoder", new CastelProtocolEncoder());
pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this));
}
};
server.setEndianness(ByteOrder.LITTLE_ENDIAN);
serverList.add(server);
server = new TrackerServer(new ConnectionlessBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("objectEncoder", new CastelProtocolEncoder());
pipeline.addLast("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this));
}
};
server.setEndianness(ByteOrder.LITTLE_ENDIAN);
serverList.add(server);
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project graphdb by neo4j-attic.
the class Protocol method addLengthFieldPipes.
public static void addLengthFieldPipes(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(MAX_FRAME_LENGTH + 4, 0, 4, 0, 4));
pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project neo4j by neo4j.
the class Protocol method addLengthFieldPipes.
public static void addLengthFieldPipes(ChannelPipeline pipeline, int frameLength) {
pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(frameLength + 4, 0, 4, 0, 4));
pipeline.addLast("frameEncoder", new LengthFieldPrepender(4));
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project Terasology by MovingBlocks.
the class TerasologyClientPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
JoinStatusImpl joinStatus = new JoinStatusImpl();
ChannelPipeline p = pipeline();
p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
p.addLast("inflateDecoder", new ZlibDecoder());
p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("authenticationHandler", new ClientHandshakeHandler(joinStatus));
p.addLast("connectionHandler", new ClientConnectionHandler(joinStatus, networkSystem));
p.addLast("handler", new ClientHandler(networkSystem));
return p;
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project traccar by tananaev.
the class NavisProtocol method initTrackerServers.
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
TrackerServer server = new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(4 * 1024, 12, 2, 2, 0));
pipeline.addLast("objectDecoder", new NavisProtocolDecoder(NavisProtocol.this));
}
};
server.setEndianness(ByteOrder.LITTLE_ENDIAN);
serverList.add(server);
}
Aggregations