RFR: 8256146: Cleanup test/jdk/java/nio/channels/DatagramChannel/Connect.java
Mark Sheppard
msheppar at openjdk.java.net
Thu Nov 12 17:35:54 UTC 2020
On Tue, 10 Nov 2020 17:06:11 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> Hi,
>
> Please find here a trivial cleanup change for test/jdk/java/nio/channels/DatagramChannel/Connect.java
> The change caters for possible evolution of the test - if we ever decided to bind the Reactor to the wildcard address;
> (the reactor is currently bound to the loopback).
>
> I would usually not bother but I had this experiment in my local workspace: it could as well be pushed as it cleans up the Actor logic which no longer has to depend on the fact that the Reactor is not bound to the wildcard.
Looks like a reasonable future proofing change :-)
Couple of minor observations and comments:
Actor constructor parameter name change: from socketAddress to either peerSocketAddress or connectSocketAddress or reactorSocketAddress to convey some semantics of its purpose.
Change of Actor member variable name from socketAddress to connectSocketAddress - again more explicit semantic description
When I saw the previous changes for this test and saw Reactor, the immediate thought was of
Reactor pattern, but it is not. Names are somewhat
idiosyncratic but Actor/Reactor don’t convey immediate semantics of the test.
The more conventional Sender/Receiver, or if one seeks a bit of OSI nostalgia
and more abstract terminology Initiator/Responder would convey clearer semantics of sending and receiving!
-------------
PR: https://git.openjdk.java.net/jdk/pull/1144
More information about the nio-dev
mailing list