在使用 netty 3.6 时关闭我的 netty 应用程序时,该进程不会在我的服务器和/或客户端引导程序上调用 releaseExternalResources() 时终止。(该项目使用ClientBootstrap和ServerBootstrap。在测试时,该过程在第一次称为引导关闭时进入无限循环)
我可以清楚地将其归结为 netty,因为它仅取决于在我的项目的 POM 中将版本号 3.5 更改为 3.6。有没有人暗示我在那个案子上?
最好的问候
马丁
编辑:我如何创建引导程序和共享线程池的单元测试,这些线程池在 Netty 3.5 下工作,在 Netty 3.6 下不工作
@Test
public void testRelease() {
// create bootstraps
final ExecutorService pool = Executors.newFixedThreadPool(2);
final ClientBootstrap client = new ClientBootstrap(
new NioClientSocketChannelFactory(pool,
Executors.newCachedThreadPool()));
final ServerBootstrap server = new ServerBootstrap(
new NioServerSocketChannelFactory(pool,
Executors.newCachedThreadPool()));
// release resources
System.out.println("Releasing resources - client...");
client.releaseExternalResources();
System.out.println("Releasing resources - server...");
server.releaseExternalResources();
}