AsynchronousChannel.close()

Gili cowwoc at bbs.darktech.org
Wed Jun 24 16:27:30 PDT 2009


Hi,

The Javadoc for AsynchronousChannel reads "Where the cancel method is
invoked with the mayInterruptIfRunning parameter set to true then the I/O
operation may be interrupted by closing the channel. In that case all
threads waiting on the result of the I/O operation throw
CancellationException and any other I/O operations outstanding on the
channel complete with the exception AsynchronousCloseException."

I don't understand the last part. Are you implying that all Futures get
CancellationException whereas all CompletionHandlers get
AsynchronousCloseException? Or did you mean something else?

The paragraph makes it seem as if Futures that are not actively being waited
on will throw AsynchronousCloseException when get() is eventually invoked.
This sounds rather difficult from an implementation point of view. Please
clarify.

Thanks,
Gili
-- 
View this message in context: http://n2.nabble.com/AsynchronousChannel.close%28%29-tp3152177p3152177.html
Sent from the nio-discuss mailing list archive at Nabble.com.




More information about the nio-discuss mailing list