8146298: (dc spec) connect and disconnect methods should specify that they may block

Brian Burkhalter brian.burkhalter at oracle.com
Tue Nov 5 20:36:21 UTC 2019


> On Nov 4, 2019, at 2:33 AM, Chris Hegarty <chris.hegarty at oracle.com> wrote:
> 
>> On 3 Nov 2019, at 20:30, Alan Bateman <Alan.Bateman at oracle.com <mailto:Alan.Bateman at oracle.com>> wrote:
>> 
>> 
>> 
>> On 01/11/2019 23:19, Brian Burkhalter wrote:
>>> 
>>> 
>>> This small change was made in the patch [1] and in the CSR linked above.
>>> 
>> Just reading this again and I'm wondering if the sentence "It will not have any effect ..." could be removed because the new text makes it clear that the method wait until outstanding I/O operations complete.

That seems reasonable.

> The new text, as is stands is vacuous. Specifically:
> 
>  "If another thread has already initiated a read or  write operation upon this channel, then an invocation of this method may block until any such operation is complete.”
> 
>   , since it uses the word “may”.
> 
> If this can be changed to be more definitive, then what you suggest could work.

s/may/will/ ?

> Given the new implNote, then we should be careful to not confuse the reader about which datagrams may be discarded. It is certainly not the one that another thread may be receiving before connect it called.

Maybe change the note to something like this?

“All datagrams remaining in the channel’s socket receive buffer, which have not been received before invoking this method, are discarded.”

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20191105/d4677ac0/attachment-0001.html>


More information about the nio-dev mailing list