Forums Register Login

nio selector

+Pie Number of slices to send: Send
Hi,
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
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 949 times.
Similar Threads
Is it possible to read data after nio socket channel closed?
Please verify if i understand NIO Selectors
NIO Selector - single threaded use
NIO Socket - connection problem
Unblocking sockets
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:38:20.