| 1 2 3 4 5 6 7 8 9 10 11 12 | if (key.isAcceptable()) { |
Apperently if I use that the select will keep returning, therefore eating up the resources.
According to this page http://www-128.ibm.com/developerworks/java/library/j-perf03174.html,
Quote
if the socket is registered with the Selector in WRITE mode, then the Selector.select() call will always return immediately, because it has at least one socket which is ready to be written to.
Now my problem, since calling register() function in a thread other than the one that calls select() will cause blocking problem. How would I write data to the channel if I can't register the channel to write state?


