RFR: 8264200: java/nio/channels/DatagramChannel/SRTest.java fails intermittently [v4]

Mark Sheppard msheppar at openjdk.java.net
Wed Apr 7 11:53:12 UTC 2021


On Wed, 7 Apr 2021 08:26:28 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Conor Cleary has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8264200: Use datagram packet for string construction
>
> LGTM!

another observation on the test structure is that each sender is bound to wildcard address, ClassicWriter explicitly through constructor and the NioWriter implicitly when it invokes send - the DatagramChannel is unbound initially, no explicit bind is invoked, and when send is invoked then the underlying socket is bound to wildcard during that call flow.
There are some subtleties when sending from a socket bound to a wildcard address bound - in this case this is minimal as the recipient address is the loopback address. 
One possible consideration is to explicitly bind the sender to the loopback address also?

Both ClassicWriter and NioWriter constructors take a port, which is the destination port of the recipient rather than a port to which they'll bind -- maybe a rename of the parameter to dstPort  ?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3354


More information about the nio-dev mailing list