8234805: (dc) Remove JNI upcall from DatagramChannel.receive implementation

Daniel Fuchs daniel.fuchs at oracle.com
Tue Nov 26 15:12:54 UTC 2019


On 26/11/2019 14:59, Alan Bateman wrote:
>>  609             int n = receive(dst, connected);
>>  610             while (IOStatus.okayToRetry(n) && isOpen()) {
>>
>>  642                 int n = receive(dst, connected);
>>  643                 while (n == IOStatus.UNAVAILABLE && isOpen()) {
>>
>> I was wondering: why the difference (line 610 vs line 643)?
> These two methods support the socket adaptor. The first is when the 
> socket is configured blocking so have to retry on EINTR. The second 
> supports timed receive where the socket is configured non-blocking.

Sorry - but both method have this assert:

  632         assert readLock.isHeldByCurrentThread() && isBlocking();

and the only difference I can see is that one will block indefinitely
while the other has a timeout.

best regards,

-- daniel


More information about the nio-dev mailing list