• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FixedLengthFrameDecoder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:FlexCommProtocol.java


示例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));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:13,代码来源:MaestroProtocol.java


示例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));
        }
    });
}
 
开发者ID:bamartinezd,项目名称:traccar-service,代码行数:11,代码来源:M2mProtocol.java


示例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;
}
 
开发者ID:HuaweiBigData,项目名称:StreamCQL,代码行数:14,代码来源:TCPServerInputOperator.java


示例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;
}
 
开发者ID:HuaweiBigData,项目名称:StreamCQL,代码行数:14,代码来源:NettyTest.java


示例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;
}
 
开发者ID:HuaweiBigData,项目名称:StreamCQL,代码行数:14,代码来源:NettyEDRTest.java


示例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;
}
 
开发者ID:HuaweiBigData,项目名称:StreamCQL,代码行数:14,代码来源:StreamingTest.java


示例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;
}
 
开发者ID:HuaweiBigData,项目名称:StreamCQL,代码行数:14,代码来源:EDRTest.java


示例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));
            }
        });
    }
}
 
开发者ID:michaelloliveira,项目名称:traccar-mongodb,代码行数:12,代码来源:ServerManager.java


示例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.");
    }
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:35,代码来源:TimestampClient.java


示例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;
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:11,代码来源:TimestampPipelineFactoryLite.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WaitBoxRunnable类代码示例发布时间:2022-05-22
下一篇:
Java FormatStack类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap