receive() method functionality
Alan Bateman
Alan.Bateman at Sun.COM
Wed Feb 25 06:14:55 PST 2009
Umashankar wrote:
> Hi Alan,
> In AsynchronousDatagramChannel, after a receive()/read() method throws
> an InterruptedByTimeoutException, what should be the behavior of
> subsequent receive/read operations on that channel. Should they work
> normally or fail with a RuntimeException ?
>
> Thanks,
> Umashankar
>
This is an excellent question as this scenario isn't completely
specified. It needs a paragraph in the class description like we have in
AsynchronousSocketChannel. I'll try to get this done for the next build.
For now, our implementation does allow you to initiate a receive or read
after a previous receive/read operation has timed out. This of course
may not be feasible on other operating systems or implementations so
don't make any assumptions in any new tests.
-Alan.
More information about the nio-dev
mailing list