-1 and orderly socket shutdown
Alan Bateman
Alan.Bateman at Sun.COM
Wed Apr 22 13:20:10 PDT 2009
Leon Finker wrote:
> I was referring to AsynchronousSocketChannel. But I guess it's to keep it
> the same as SocketChannel. In AsynchronousSocketChannel one would not get 0
> bytes read for tcp, correct? One can get 0 bytes for udp.
>
If you invoke AsynchronousSocketChannel#read with a buffer that has 0
bytes remaining then it completes immediately with a result of 0 (no I/O
operation is initiated).
-Alan.
More information about the nio-discuss
mailing list