pending read/failed callback/IOException
Alan.Bateman at Sun.COM
Wed Apr 22 13:45:26 PDT 2009
Leon Finker wrote:
> I'm just starting with nio.2.
> I noticed that when closing the channel, unless
> AsynchronousSocketChannel.shutdownOutput is called, one would get the
> following exception object in the failed() callback with pending read():
> java.io.IOException: The specified network name is no longer available.
> at sun.nio.ch.Iocp.translateErrorToIOException(Unknown Source)
> at sun.nio.ch.Iocp.access$700(Unknown Source)
> at sun.nio.ch.Iocp$EventHandlerTask.run(Unknown Source)
> at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> at java.lang.Thread.run(Unknown Source)
> Calling just .close or .shutdownInput followed by .close still produces the
> exception. Calling AsynchronousSocketChannel.shutdownOutput followed by
> close, will not produce the exception. I'm on build b55. Doesn't seem
> correct behavior to me. Thanks!
This stack trace doesn't look like an asynchronous close but rather the
I/O exception when the peer terminates the connection abruptly. I think
you'll need to describe things in more detail to diagnose it (or a small
test case would be better).
More information about the nio-dev