Strange Exception at read

向雅 fyaoxy at
Thu Nov 12 04:05:12 PST 2009


2009/11/12 Alan Bateman <Alan.Bateman at>:
> 向雅 wrote:
>> Hi Alan,
>> After tired the aio Socket channel and File channel, I found those use
>> different Exception process way seperately.
>> For some os error , File channel use some Exception classes, but
>> Socket channel use IOException with os error message. The later hard
>> to determinate to advance processing.
>> There have some plan to unify those exceptions with os error?
>> 致敬
>> 向雅
> I'm aware of a couple of cases (AsynchronousSocketChannel.connect on Windows
> for example) where we don't translate the OS error with the result that we
> throw an IOException rather than the more specific ConnectException that
> SocketChannel and legacy Socket might throw. Is that what you are thinking
> about?
> -Alan.

for example the IOException in this message, I got a "IOException:
Access Denied".
I debug to Iocp get the os errno: 5, windows system error number.
I tested aio File channel, I get the errno 5 again, but it wrapped
with AccessDeniedException.
So I browsed the new file channel implementation, besides
there have more specific exception.


More information about the nio-dev mailing list