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


Java ChannelFactory.releaseExternalResources方法代码示例

本文整理汇总了Java中org.jboss.netty.channel.ChannelFactory.releaseExternalResources方法的典型用法代码示例。如果您正苦于以下问题:Java ChannelFactory.releaseExternalResources方法的具体用法?Java ChannelFactory.releaseExternalResources怎么用?Java ChannelFactory.releaseExternalResources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.netty.channel.ChannelFactory的用法示例。


在下文中一共展示了ChannelFactory.releaseExternalResources方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.jboss.netty.channel.ChannelFactory; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {        

        Executor executor = Executors.newCachedThreadPool();
        ChannelFactory factory = new NioServerSocketChannelFactory(executor, executor);
        ServerBootstrap sb = new ServerBootstrap(factory);
        ClientSocketChannelFactory cf = new NioClientSocketChannelFactory(executor, executor);
        sb.setPipelineFactory(new ProxyPipelineFactory(cf,
                RtmpConfig.PROXY_REMOTE_HOST, RtmpConfig.PROXY_REMOTE_PORT));
        InetSocketAddress socketAddress = new InetSocketAddress(RtmpConfig.PROXY_PORT);
        sb.bind(socketAddress);
        logger.info("proxy server started, listening on {}", socketAddress);

        Thread monitor = new StopMonitor(RtmpConfig.PROXY_STOP_PORT);
        monitor.start();
        monitor.join();

        ChannelGroupFuture future = ALL_CHANNELS.close();
        logger.info("closing channels");
        future.awaitUninterruptibly();
        logger.info("releasing resources");
        factory.releaseExternalResources();
        logger.info("server stopped");

    }
 
开发者ID:bruni68510,项目名称:flazr,代码行数:25,代码来源:RtmpProxy.java

示例2: main

import org.jboss.netty.channel.ChannelFactory; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        final ChannelFactory factory = new NioServerSocketChannelFactory(
                Executors.newCachedThreadPool(),
                Executors.newCachedThreadPool());

        final ServerBootstrap bootstrap = new ServerBootstrap(factory);

        bootstrap.setPipelineFactory(new ServerPipelineFactory());
        bootstrap.setOption("child.tcpNoDelay", true);
        bootstrap.setOption("child.keepAlive", true);

        final InetSocketAddress socketAddress = new InetSocketAddress(RtmpConfig.SERVER_PORT);
        bootstrap.bind(socketAddress);
        logger.info("server started, listening on: {}", socketAddress);

        final Thread monitor = new StopMonitor(RtmpConfig.SERVER_STOP_PORT);
        monitor.start();        
        monitor.join();

        TIMER.stop();
        final ChannelGroupFuture future = CHANNELS.close();
        logger.info("closing channels");
        future.awaitUninterruptibly();
        logger.info("releasing resources");
        factory.releaseExternalResources();
        logger.info("server stopped");

    }
 
开发者ID:bruni68510,项目名称:flazr,代码行数:30,代码来源:RtmpServer.java

示例3: releaseExternalResources

import org.jboss.netty.channel.ChannelFactory; //导入方法依赖的package包/类
/**
 * This method simply delegates the call to
 * {@link ChannelFactory#releaseExternalResources()}.
 */
public void releaseExternalResources() {
    ChannelFactory factory = this.factory;
    if (factory != null) {
        factory.releaseExternalResources();
    }
}
 
开发者ID:urunimi,项目名称:android-netty,代码行数:11,代码来源:Bootstrap.java


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