AsynchronousSocketChannel: abortable operations throw RuntimeException
Alan Bateman
Alan.Bateman at oracle.com
Mon Oct 18 02:54:37 PDT 2010
Gili wrote:
> :
> Are you saying that it's impossible for any AsynchronousByteChannel
> implementation to continue to use a connection after cancellation? Or were
> your comments specific to AsynchronousSocketChannel?
>
> Are you saying that no operating system supports this? Or are you saying
> that some operating systems do not, hence we cannot guarantee it in a
> cross-platform manner?
>
>
All we are saying (in AsynchronousChannel, the top-most interface) is
that it is highly implementation specific if invoking cancel will
actually cancel the underlying I/O operation in a manner that guarantees
that bytes have not been transferred. With a stream connection
(AsynchronousSocketChannel) then you will essentially have a corrupt
stream if bytes were transferred and you continued to use the
connection. I've no doubt the usage with your serial port channel will
be a different in that data loss is something that it will have to deal
with anyway.
-Alan
More information about the nio-discuss
mailing list