AsynchronousSocketChannel operation cancelling on b145

Alan Bateman Alan.Bateman at oracle.com
Tue Jun 21 08:56:44 PDT 2011


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.


More information about the jdk7-dev mailing list