• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

nio selector

sony gam
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do the following using the nio package of the 1.4 package:
My server socket blocks on accept.
As soon as it returns with a socket, I register the channel associated with that socket to a Selector, which registers for read operations.
When the Selector select method returns with a key, I assign the reading task to another thread from a pool.
This way as new clients keep connecting to me, I register the sockets asscoiated with them with a selector and upon receiving any message will use a thread to process that message.
But the problem is even though I am pumping output from my client, the selector is never selecting the correspinding keys.
I was wondering if anyone who has worked on the nio package could suggest something here.
Thanking you,
Sony Gam
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic