Hi Chris,

On 13/03/2019 17:32, Chris Hegarty wrote:
I think that is most cases
it should be possible to just replace the use of `getHostAddress` with
`getHostName`. This defers the actual lookup to the system configured
name service ( rather than trying to encode IPv6 addresses in the
test )
I think I'd prefer to use getHostAddress() and one of the multi
arg constructors for  URI/URL instead, as it makes it more explicit
that you're using the same address on both side of the connection.

Are we otherwise sure that the hostname would resolve to the
exact same address?

For instance:

jshell> InetAddress.getLoopbackAddress().getHostName()
$7 ==> "localhost"

jshell> InetAddress.getAllByName("localhost");
$8 ==> InetAddress[3] {
          localhost/127.0.0.1,
          localhost/0:0:0:0:0:0:0:1,
          localhost/fe80:0:0:0:0:0:0:1%1
       }

best regards,

-- daniel

Reply via email to