當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。