I'm building a server with NIO ServerSocketChannel , this server have 2 ports for clients connections,
what is the best solution, to make a Selector for each port, or a Selector for both ports?
If the server is in non blocking mode, and the client for sending data uses the blocking sockets, can this cause any problems?
Edited by: tmazight on Jul 8, 2012 8:23 PM
The only thing it can boost performance of is the accept() process, and you wouldn't call that a bottleneck. Not with only 2 listening ports. If you had 1000 it might become an interesting question but I doubt that either implementation would be significantly better. The whole idea of NIO is to handle multiple channels in one thread.