Hello, I solved the problem by using another NettyTransceiver constructor:
NettyTransceiver(InetSocketAddress addr, org.jboss.netty.channel.ChannelFactory channelFactory) Creation of ChannelFactory is like this. ChannelFactory cf = new NioClientSocketChannelFactory( new ThreadPoolExecutor(0, Integer.MAX_VALUE, 1L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>()), new ThreadPoolExecutor(0, Integer.MAX_VALUE, 1L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>())); Finally, I call cf.shutdown() before the main thread exits. And the application process terminates immediately after the main method finishes. I am not sure how long the keepAlive of ThreadPoolExecutor(default is 60 seconds) should be. But I need to control the value myself anyway. Thanks, Tada
