Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0
-
None
-
None
-
Not applicable
Description
org.apache.commons.net.SocketClient method connect (line 225) doesn't use the configured timeout value.
Original code:
SocketClient.java (line 225)
public void connect(String hostname, int port, InetAddress localAddr, int localPort) throws SocketException, IOException { _socket_ = _socketFactory_.createSocket(hostname, port, localAddr, localPort); _connectAction_(); }
Working alternative:
SocketClient.java (line 225)
public void connect(String hostname, int port, InetAddress localAddr, int localPort) throws SocketException, IOException { _socket_ = _socketFactory_.createSocket(); _socket_.bind(new InetSocketAddress(localAddr, localPort)); _socket_.connect(new InetSocketAddress(hostname, port), connectTimeout); _connectAction_(); }