Closed danips closed 5 months ago
InetAddress.getByName() seems to have issues when the network is both IPv4 and IPv6. It will return ::1
By using InetAddress.getAllByName() we can choose the IPv4 address if there is one, or the first IPv6 address if no IPv4 address is found.
InetAddress.getByName() seems to have issues when the network is both IPv4 and IPv6. It will return ::1
By using InetAddress.getAllByName() we can choose the IPv4 address if there is one, or the first IPv6 address if no IPv4 address is found.