RFR: 8299827: Add resolved IP address in connection exception for sockets [v2]

Vyom Tewari vtewari at openjdk.org
Sat Jan 14 05:15:10 UTC 2023


On Fri, 13 Jan 2023 18:21:46 GMT, Ralf Schmelter <rschmelter at openjdk.org> wrote:

>> This change adds the resolved IP address to the exception text of a failed socket connection. This helps if the connection failed because of stale DNS entries.
>
> Ralf Schmelter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Simplified code

src/java.base/share/classes/sun/net/util/SocketExceptions.java line 75:

> 73:         sb.append(": ");
> 74:         sb.append(addr.toString());
> 75:         String enhancedMsg = sb.toString();

do you need extra "enhancedMsg" ? you can directly use "return create(e, sb.toString());"

-------------

PR: https://git.openjdk.org/jdk/pull/11961


More information about the net-dev mailing list