我使用netty3.4.2 连接到服务器启动的服务器 代码是:
ThreadPoolExecutor bossExecutor = new ThreadPoolExecutor(1, 5, 20L, TimeUnit.SECONDS,new SynchronousQueue<Runnable>(),new ThreadPoolExecutor.CallerRunsPolicy());
ThreadPoolExecutor workerExecutor = new ThreadPoolExecutor(1, 10, 20L, TimeUnit.SECONDS,new SynchronousQueue<Runnable>(),new ThreadPoolExecutor.CallerRunsPolicy());
NioClientSocketChannelFactory clientSocketChannelFactory = new NioClientSocketChannelFactory(bossExecutor,workerExecutor);
ClientBootstrap clientBootstrap = new ClientBootstrap(clientSocketChannelFactory);
...
...
clientBootstrap.connect(..);
调用connect方法,服务器关闭。然后重新连接服务器,但会产生更多线程?