本文整理汇总了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();
}
}