• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Understanding ServerSocketChannel, backlogs etc..

Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ?

Thanks all

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic