本文整理汇总了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);
}
示例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);
}
示例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));
}
});
}
示例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);
}
示例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));
}
});
}
示例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);
}
示例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));
}
});
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
});
}
示例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));
}
});
}
示例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));
}
});
}
示例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);
}
示例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));
}
});
}