use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project traccar by tananaev.
the class RitiProtocol 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, 105, 2, 3, 0));
pipeline.addLast("objectDecoder", new RitiProtocolDecoder(RitiProtocol.this));
}
};
server.setEndianness(ByteOrder.LITTLE_ENDIAN);
serverList.add(server);
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project Terasology by MovingBlocks.
the class InfoRequestPipelineFactory method getPipeline.
@Override
public ChannelPipeline getPipeline() throws Exception {
JoinStatusImpl joinStatus = new JoinStatusImpl();
ChannelPipeline p = Channels.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 ServerInfoRequestHandler());
return p;
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project traccar by traccar.
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);
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project traccar by traccar.
the class RitiProtocol 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, 105, 2, 3, 0));
pipeline.addLast("objectDecoder", new RitiProtocolDecoder(RitiProtocol.this));
}
};
server.setEndianness(ByteOrder.LITTLE_ENDIAN);
serverList.add(server);
}
use of org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder in project traccar by traccar.
the class GatorProtocol method initTrackerServers.
@Override
public void initTrackerServers(List<TrackerServer> serverList) {
serverList.add(new TrackerServer(new ServerBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1024, 3, 2));
pipeline.addLast("objectDecoder", new GatorProtocolDecoder(GatorProtocol.this));
}
});
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("objectDecoder", new GatorProtocolDecoder(GatorProtocol.this));
}
});
}
Aggregations