asychronous io with callbacks
I want to implement a serverconnection that asychronous write and read with callbacks. Can you guys give me any tutorial?
I tried this with java.nio but the problem is that if i set intresOPs to read the selector.select(); will NEVER select for read (-> deadlock), even if the server is writing!
Basically i want something like this:
a networkthread that runs and blocks at a point until the socket became ready for read or write.
then once in a while i put some bytebuffer onto a stack that should be send, and also read data!