From 89141a11f985e9c5bbc156304ad6d6e53a484d72 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 8 Sep 2020 23:53:45 +0200 Subject: [PATCH] Code polish --- src/dorkbox/netUtil/IP.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dorkbox/netUtil/IP.kt b/src/dorkbox/netUtil/IP.kt index 4c9cf29..c01d8bd 100644 --- a/src/dorkbox/netUtil/IP.kt +++ b/src/dorkbox/netUtil/IP.kt @@ -197,7 +197,7 @@ object IP { */ fun toString(ip: InetAddress, ipv4Mapped: Boolean = false): String { if (ip is Inet4Address) { - return ip.getHostAddress() + return IPv4.toString(ip) } require(ip is Inet6Address) { "Unhandled type: $ip" } @@ -208,7 +208,6 @@ object IP { /** * Returns the [String] representation of an [InetSocketAddress]. * - * * The output does not include Scope ID. * @param addr [InetSocketAddress] to be converted to an address string * @return `String` containing the text-formatted IP address