8146298: (dc spec) connect and disconnect methods should specify that they may block
Chris Hegarty
chris.hegarty at oracle.com
Mon Nov 4 10:33:58 UTC 2019
> On 3 Nov 2019, at 20:30, Alan Bateman <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.
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.
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.
-Chris.
More information about the nio-dev
mailing list