本文整理汇总了Java中org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder类的典型用法代码示例。如果您正苦于以下问题:Java FixedLengthFrameDecoder类的具体用法?Java FixedLengthFrameDecoder怎么用?Java FixedLengthFrameDecoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FixedLengthFrameDecoder类属于org.jboss.netty.handler.codec.frame包,在下文中一共展示了FixedLengthFrameDecoder类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTrackerServers
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的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 FixedLengthFrameDecoder(2 + 2 + 101 + 5));
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("stringDecoder", new StringDecoder());
pipeline.addLast("objectDecoder", new FlexCommProtocolDecoder(FlexCommProtocol.this));
}
});
}
示例2: initTrackerServers
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的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 FixedLengthFrameDecoder(160));
pipeline.addLast("stringEncoder", new StringEncoder());
pipeline.addLast("stringDecoder", new StringDecoder());
pipeline.addLast("objectDecoder", new MaestroProtocolDecoder(MaestroProtocol.this));
}
});
}
示例3: initTrackerServers
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的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 FixedLengthFrameDecoder(23));
pipeline.addLast("objectDecoder", new M2mProtocolDecoder(M2mProtocol.this));
}
});
}
示例4: getPipeline
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ChannelPipeline getPipeline()
throws Exception
{
ChannelPipeline pipleline = Channels.pipeline();
pipleline.addLast("encode", new SocksMessageEncoder());
pipleline.addLast("decode", new FixedLengthFrameDecoder(fixedLength));
pipleline.addLast("handler", new NettyServerHandler());
return pipleline;
}
示例5: getPipeline
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ChannelPipeline getPipeline()
throws Exception
{
ChannelPipeline pipleline = Channels.pipeline();
pipleline.addLast("encode", new SocksMessageEncoder());
pipleline.addLast("decode", new FixedLengthFrameDecoder(883));
pipleline.addLast("handler", new NettyServerHandler());
return pipleline;
}
示例6: getPipeline
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ChannelPipeline getPipeline()
throws Exception
{
ChannelPipeline pipleline = Channels.pipeline();
pipleline.addLast("encode", new SocksMessageEncoder());
pipleline.addLast("decode", new FixedLengthFrameDecoder(1165));
pipleline.addLast("handler", new NettyServerHandler());
return pipleline;
}
示例7: getPipeline
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ChannelPipeline getPipeline()
throws Exception
{
ChannelPipeline pipleline = Channels.pipeline();
pipleline.addLast("encode", new SocksMessageEncoder());
pipleline.addLast("decode", new FixedLengthFrameDecoder(844));
pipleline.addLast("handler", new NettyServerHandler());
return pipleline;
}
示例8: getPipeline
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ChannelPipeline getPipeline()
throws Exception
{
ChannelPipeline pipleline = Channels.pipeline();
pipleline.addLast("encode", new SocksMessageEncoder());
pipleline.addLast("decode", new FixedLengthFrameDecoder(FIX_LENGTH));
pipleline.addLast("handler", new NettyServerHandler());
return pipleline;
}
示例9: initM2mServer
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
private void initM2mServer(String protocol) throws SQLException {
if (isProtocolEnabled(properties, protocol)) {
serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) {
@Override
protected void addSpecificHandlers(ChannelPipeline pipeline) {
pipeline.addLast("frameDecoder", new FixedLengthFrameDecoder(23));
pipeline.addLast("objectDecoder", new M2mProtocolDecoder(ServerManager.this));
}
});
}
}
示例10: TimestampClient
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
public TimestampClient(int timeoutMillis,TimestampHostProvider timestampHostProvider) {
this.timeoutMillis = timeoutMillis;
this.timestampHostProvider = timestampHostProvider;
clientCallbacks = new ConcurrentHashMap<>();
ExecutorService workerExecutor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("timestampClient-worker-%d").setDaemon(true).build());
ExecutorService bossExecutor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("timestampClient-boss-%d").setDaemon(true).build());
factory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor);
bootstrap = new ClientBootstrap(factory);
// If we end up needing to use one of the memory aware executors,
// do so with code like this (leave commented out for reference).
//
// bootstrap.getPipeline().addLast("executor", new ExecutionHandler(
// new OrderedMemoryAwareThreadPoolExecutor(10 /* threads */, 1024*1024, 4*1024*1024)));
bootstrap.getPipeline().addLast("decoder", new FixedLengthFrameDecoder(FIXED_MSG_RECEIVED_LENGTH));
bootstrap.getPipeline().addLast("handler", this);
bootstrap.setOption("tcpNoDelay", false);
bootstrap.setOption("keepAlive", true);
bootstrap.setOption("reuseAddress", true);
// bootstrap.setOption("connectTimeoutMillis", 120000);
// Would be nice to try connecting here, but not sure if this works right. connectIfNeeded();
try {
registerJMX();
} catch (Exception e) {
SpliceLogUtils.error(LOG, "Unable to register TimestampClient with JMX. Timestamps will still be generated but metrics will not be available.");
}
}
示例11: getPipeline
import org.jboss.netty.handler.codec.frame.FixedLengthFrameDecoder; //导入依赖的package包/类
@Override
public ChannelPipeline getPipeline() throws Exception {
SpliceLogUtils.debug(LOG, "Creating new channel pipeline...");
ChannelPipeline pipeline = Channels.pipeline();
((TimestampServerHandler) tsHandler).initializeIfNeeded();
pipeline.addLast("decoder", new FixedLengthFrameDecoder(TimestampServer.FIXED_MSG_RECEIVED_LENGTH));
pipeline.addLast("handler", tsHandler);
SpliceLogUtils.debug(LOG, "Done creating channel pipeline");
return pipeline;
}