exceptionfactory opened a new pull request, #138:
URL: https://github.com/apache/commons-net/pull/138

   This pull request presents a solution of 
[NET-650](https://issues.apache.org/jira/browse/NET-650), delegating remote 
host resolution to `java.net.Socket.connect()` instead of performing host 
resolution earlier in `org.apache.commons.net.SocketClient.connect()` methods.
   
   For `SocketClient.connect()` methods that accept a `String` value for the 
`hostname` argument, the existing implementation calls 
`InetAddress.getByName(hostname)`, performing host resolution prior to calling 
`Socket.connect()`. This works for use cases where the remote host DNS address 
is resolvable, but does not work for scenarios where the remote host must be 
resolved through a proxy server.
   
   The `new InetSocketAddress(String hostname, int port)` constructor attempts 
name resolution, but catches the `UnknownHostException` and allows the hostname 
to remain unresolved. This behavior allows custom Java `SocketFactory` 
implementations to pass the unresolved hostname to a remote proxy server, where 
name resolution may succeed, allowing the connection to proceed.
   
   Changing the `SocketClient.connect()` methods to construct an 
`InetSocketAddress` should support existing standard behavior while also 
supporting additional use cases like proxy-based name resolution.
   
   The pull request includes a new `_remoteAddress_` member in `SocketClient`, 
which supports new unit test methods that check the status of 
`InetSocketAddress.isUnresolved()` after expecting particular exceptions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to