AsynchronousSocketChannel: abortable operations throw RuntimeException
cowwoc at bbs.darktech.org
Thu Oct 14 20:58:11 PDT 2010
Alan Bateman wrote:
> In this API, it's only cancel(true) that may close the channel. The
> timeout support specified by AsynchronousSocketChannel is effectively
> like cancel(false) and does not close the channel. From your previous
> mail, I assumed were asking for a method to find out if cancel(false) or
> timeout can guarantee to cancel underlying I/O operations with a
> guarantee that the connection will be in consistent state (which
> suggests that were you looking for a way to continue to use the
> connection after cancellation, something the spec cannot guarantee).
Having re-read your message I now understand that you are commenting
exclusively on AsynchronousSocketChannel. This re-enforces what I said
earlier on: we should be able to guarantee at compile-time whether a class
allows reusing the channel after a timeout. All implementations of
AsynchronousSocketChannel would return false. All implementations of
AsynchronousSerialPortChannel would return true.
View this message in context: http://nio-discuss.970641.n3.nabble.com/AsynchrnousSocketChannel-abortable-operations-throw-RuntimeException-tp1692482p1705587.html
Sent from the nio-discuss mailing list archive at Nabble.com.
More information about the nio-discuss