本文整理匯總了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");
}
示例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");
}
示例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();
}
}