RFR: 8264200: java/nio/channels/DatagramChannel/SRTest.java fails intermittently [v4]
Daniel Fuchs
dfuchs at openjdk.java.net
Wed Apr 7 13:04:24 UTC 2021
On Wed, 7 Apr 2021 11:50:45 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:
>> 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 ?
@msheppar I would rather not change the way that the senders are bound, unless it is verified that this is causing problems and we are able to figure out why.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3354
More information about the nio-dev
mailing list