Instead of using a selector in the usual way, where for each ready channel a message can be determined and sent, I'd like to choose whichever connection is currently ready and send a message there.
Presumably this can be done by throwing all the channels into a selector for reading and marking them ready for reading if they come out, then doing the same for writing, and then choosing from among those that I've marked ready.
Is this a good idea, is there a better way to do this, and what should I watch out for? For example, the Rox Tutorial states "If you try to mix OP READ and OP WRITE you'll quickly get yourself into trouble. The Sun Windows implementation has been seen to deadlock if you do this." Are there similar gotchas here? What is the best way to implement:
boolean isReadyForRead(SocketChannel c);
boolean isReadyForWrite(SocketChannel c);