AsynchronousSocketChannel still throws unspecified exception

Alan Bateman Alan.Bateman at oracle.com
Wed Jul 13 11:48:11 PDT 2011


cowwoc wrote:
>
>     I don't see why the <= 0 case is less clear. The way I see it, 
> read() is an asynchronous layer on top of a synchronous readImpl() 
> API. If we're saying that timeout <= 0 means "return immediately" then 
> surely readImpl(timeout<=0) should return right away. read() isn't 
> part of the equation because (as we both agree) the timeouts are 
> really parameters for readImpl(), not read().
It's not generally a layer over a synchronous API in blocking mode as 
that would be problematic when there are tens of thousands of 
connections. The timeout is also not generally something that the 
underlying implementation knows about either. It could do in some 
implementations but it is more likely to be an add-on with the 
underlying implementation making use of the operating system's 
asynchronous I/O support or maybe be based on non-blocking I/O.

All I can say is that we can look at this for jdk8 and decide whether we 
need this and what the API should be. We can use 7063249 that you 
created to track it.

-Alan.


More information about the nio-dev mailing list