Michael Qi wrote:
Hi,I write a simple program to test SocketConnector, I start 10 connector but when 5 has connected, it hangs. Could you tell me why?
Your thread pool runs out of threads.Each SocketConnector consumes two threads from the pool, and because you use an unbounded queue, the pool does not grow. SocketConnectors also consume file descriptors, and need to be disposed properly. Failing to do so causes fd leakage at least in MINA 2.