I've noticed that even if I don't call ServerSocketChannel.accept() [by pausing the thread in a debugger], my clients' connection requests have been accepted under the covers of the nio framework. i.e. the connection is already established by the OS. ServerSocketChannel.accept() just returns a SocketChannel wrapped around a peer Socket that already exists. I confirmed this by doing a netstat:
Is my understanding correct ?
Secondly, can anyone tell me what backlog parameter is for when doing a ServerSocket.bind ? I set it to 2 randomly. What should be a reasonable value ?