当前位置: 首页>>代码示例>>Java>>正文


Java LengthFieldBasedFrameDecoder类代码示例

本文整理汇总了Java中org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder的典型用法代码示例。如果您正苦于以下问题:Java LengthFieldBasedFrameDecoder类的具体用法?Java LengthFieldBasedFrameDecoder怎么用?Java LengthFieldBasedFrameDecoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LengthFieldBasedFrameDecoder类属于org.jboss.netty.handler.codec.frame包,在下文中一共展示了LengthFieldBasedFrameDecoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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 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("objectDecoder", new CastelProtocolDecoder(CastelProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:22,代码来源:CastelProtocol.java

示例2: RemoteRunMaster

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
/**
 * Creates a new RemoteRunMaster.
 *
 * @param bossExecutor the {@link Executor} which will execute the boss threads, see
 * {@link org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory(Executor, Executor)}
 * @param workerExecutor the {@link Executor} which will execute the I/O worker threads, see
 * {@link org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory(Executor, Executor)}
 * @param callback optional callback when agents connect/send messages
 */
public RemoteRunMaster(Executor bossExecutor, Executor workerExecutor, AgentConnectionCallback callback) {
  this.callback = callback;
  NioServerSocketChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);
  bootstrap = new ServerBootstrap(factory);
  bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
    @Override
    public ChannelPipeline getPipeline() throws Exception {
      return Channels.pipeline(
        new SslHandler(createSslEngine()),

        new LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4),
        new LengthFieldPrepender(4),

        new ProtobufDecoder(RemoteRun.AgentToMaster.getDefaultInstance()),
        new ProtobufEncoder(),

        new NettyLoggingHandler(),
        RemoteRunMaster.this
      );
    }
  });
  bootstrap.setOption("child.tcpNoDelay", true);
  bootstrap.setOption("child.keepAlive", true);
}
 
开发者ID:formicary,项目名称:remoterun,代码行数:34,代码来源:RemoteRunMaster.java

示例3: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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, 2, 2, -4, 0));
            pipeline.addLast("objectEncoder", new CityeasyProtocolEncoder());
            pipeline.addLast("objectDecoder", new CityeasyProtocolDecoder(CityeasyProtocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:12,代码来源:CityeasyProtocol.java

示例4: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:ProgressProtocol.java

示例5: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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(256, 2, 1, 2, 0));
            pipeline.addLast("objectDecoder", new Gt02ProtocolDecoder(Gt02Protocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:11,代码来源:Gt02Protocol.java

示例6: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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, 3, 2));
            pipeline.addLast("objectDecoder", new DmtProtocolDecoder(DmtProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:DmtProtocol.java

示例7: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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, 0, 2, 2, 0));
            pipeline.addLast("objectEncoder", new RuptelaProtocolEncoder());
            pipeline.addLast("objectDecoder", new RuptelaProtocolDecoder(RuptelaProtocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:12,代码来源:RuptelaProtocol.java

示例8: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:NavisProtocol.java

示例9: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:RitiProtocol.java

示例10: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:15,代码来源:AdmProtocol.java

示例11: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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(256, 2, 2, 2, 0));
            pipeline.addLast("objectDecoder", new TzoneProtocolDecoder(TzoneProtocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:11,代码来源:TzoneProtocol.java

示例12: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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());
            pipeline.addLast("objectDecoder", new EelinkProtocolDecoder(EelinkProtocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:12,代码来源:EelinkProtocol.java

示例13: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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, 2 + 12 + 1 + 1, 2, 2, 0));
            pipeline.addLast("objectDecoder", new ThinkRaceProtocolDecoder(ThinkRaceProtocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:11,代码来源:ThinkRaceProtocol.java

示例14: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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 ApelProtocolDecoder(ApelProtocol.this));
        }
    };
    server.setEndianness(ByteOrder.LITTLE_ENDIAN);
    serverList.add(server);
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:ApelProtocol.java

示例15: initTrackerServers

import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder; //导入依赖的package包/类
@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, -5, 0));
            pipeline.addLast("objectEncoder", new T800xProtocolEncoder());
            pipeline.addLast("objectDecoder", new T800xProtocolDecoder(T800xProtocol.this));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:12,代码来源:T800xProtocol.java


注:本文中的org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。