Strange Exception at read

向雅 fyaoxy at gmail.com
Sat Nov 14 17:00:50 PST 2009


2009/11/14 Alan Bateman <Alan.Bateman at sun.com>:
> 向雅 wrote:
>>
>> :
>> Java_sun_nio_ch_WindowsAsynchronousSocketChannelImpl_read0 use the
>> method directly:
>> JNU_ThrowIOExceptionWithLastError, which use JVM_GetLastErrorString.
>> The later be there very long time:) and it discard the error code.:)
>> But be happy we not encount so much those kind error:)
>>
>
> I don't see a problem here - on Windows an error can occur when initiating
> the I/O operation or the I/O operation can complete with an error. The code
> you are looking at is where the I/O operation is initiated. If that fails
> then the error is translated into the appropriate system message and this is
> used as the detail message in the IOException notified to the completion
> handler. You need to look in Iocp.java to see the code that handles the
> completion of I/O operations. There you will see that it also attempts to
> translate errors into the appropriate system message. For your firewall
> issue it is working exactly as it should in that it translate the error 5
> into "Access denied".

The code self is not problem.
I  emphasised is that
I not think that directly translating errno to system message to wrap
into an IOException is great thing.
Though at most we cannot do recovery actions which should not be exclude.
If do so actions, the IOException self would be source of problem.
Yes, I did check out those code. because I wanna see all what I can
see.:) so I proposal maybe not discard the the system errno.
And I said, in most case we not care of those kind. I mean maybe more
better If do some additional process .

Regards,
qinxian


More information about the nio-dev mailing list