Strange Exception at read

Alan Bateman Alan.Bateman at Sun.COM
Sat Nov 14 06:54:09 PST 2009

向雅 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 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".


More information about the nio-dev mailing list