Search in sources :

Example 1 with FixedLengthFrameDecoder

use of org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder in project traccar by tananaev.

the class PricolProtocol 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 FixedLengthFrameDecoder(64));
            pipeline.addLast("objectDecoder", new PricolProtocolDecoder(PricolProtocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("objectDecoder", new PricolProtocolDecoder(PricolProtocol.this));
        }
    });
}
Also used : FixedLengthFrameDecoder(org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder) TrackerServer(org.traccar.TrackerServer) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Aggregations

ConnectionlessBootstrap (org.jboss.netty.bootstrap.ConnectionlessBootstrap)1 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)1 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)1 FixedLengthFrameDecoder (org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder)1 TrackerServer (org.traccar.TrackerServer)1