Gian Franco Zabarino wrote:
I've been testing this on b145, and after I cancel a read request by
cancelling the Future, I can no longer use the
AsynchronousSocketChannel for reading. On NIO I always had the
opportunity to remove the key from the Selector, and then to register
the SocketChannel with another selector... Is there anyway to do this
using NIO.2? Sometimes I need to read for detecting if a Socket was
disconnected, and sometimes I need to read for user input. Both reads
have different CompletionHandler classes, and different timeout
parameters. Greetings
Gian Franco Zabarino
There is a big section on cancellation in the javadoc (se
AsynchronousChannel). I would suggest going through that and bring any
follow-up questions to nio-discuss.
-Alan.