Search in sources :

Example 1 with LengthFieldBasedFrameDecoder

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

the class AdmProtocol 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, 1, -3, 0));
            pipeline.addLast("stringEncoder", new StringEncoder());
            pipeline.addLast("objectEncoder", new AdmProtocolEncoder());
            pipeline.addLast("objectDecoder", new AdmProtocolDecoder(AdmProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : StringEncoder(org.jboss.netty.handler.codec.string.StringEncoder) TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 2 with LengthFieldBasedFrameDecoder

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

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);
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 3 with LengthFieldBasedFrameDecoder

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

the class EelinkProtocol 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("objectEncoder", new EelinkProtocolEncoder(false));
            pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this));
        }
    });
    serverList.add(new TrackerServer(new ConnectionlessBootstrap(), getName()) {

        @Override
        protected void addSpecificHandlers(ChannelPipeline pipeline) {
            pipeline.addLast("objectEncoder", new EelinkProtocolEncoder(true));
            pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this));
        }
    });
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline) ConnectionlessBootstrap(org.jboss.netty.bootstrap.ConnectionlessBootstrap)

Example 4 with LengthFieldBasedFrameDecoder

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

the class ProgressProtocol 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("objectDecoder", new ProgressProtocolDecoder(ProgressProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Example 5 with LengthFieldBasedFrameDecoder

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

the class RecodaProtocol 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, 4, 4, -8, 0));
            pipeline.addLast("objectDecoder", new RecodaProtocolDecoder(RecodaProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
Also used : TrackerServer(org.traccar.TrackerServer) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

LengthFieldBasedFrameDecoder (org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder)26 ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)24 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)22 TrackerServer (org.traccar.TrackerServer)22 ConnectionlessBootstrap (org.jboss.netty.bootstrap.ConnectionlessBootstrap)8 ZlibDecoder (org.jboss.netty.handler.codec.compression.ZlibDecoder)2 LengthFieldPrepender (org.jboss.netty.handler.codec.frame.LengthFieldPrepender)2 ProtobufDecoder (org.jboss.netty.handler.codec.protobuf.ProtobufDecoder)2 ProtobufEncoder (org.jboss.netty.handler.codec.protobuf.ProtobufEncoder)2 ProtobufVarint32FrameDecoder (org.jboss.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder)2 ProtobufVarint32LengthFieldPrepender (org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender)2 StringEncoder (org.jboss.netty.handler.codec.string.StringEncoder)2 ClientHandshakeHandler (org.terasology.network.internal.ClientHandshakeHandler)2 JoinStatusImpl (org.terasology.network.internal.JoinStatusImpl)2 MetricRecordingHandler (org.terasology.network.internal.MetricRecordingHandler)2 ClientConnectionHandler (org.terasology.network.internal.ClientConnectionHandler)1 ClientHandler (org.terasology.network.internal.ClientHandler)1 ServerInfoRequestHandler (org.terasology.network.internal.ServerInfoRequestHandler)1