Skip to content

Commit

Permalink
Remove unnecessary socket binding & update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
velitasali committed Jan 5, 2021
1 parent 656ab47 commit 0ffe81f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ public static ActiveConnection connect(SocketAddress socketAddress) throws IOExc

/**
* Connects to a CoolSocket server.
* <p>
* This doesn't use {@link javax.net.SocketFactory} because it doesn't offer a parameter to set the timeout.
* If you need to use it, please use the constructor methods and pass the socket instance, instead.
*
* @param socketAddress The server address to connection.
* @param readTimeout The maximum time allowed during reading from the input channel.
Expand All @@ -170,7 +173,6 @@ public static ActiveConnection connect(SocketAddress socketAddress) throws IOExc
public static ActiveConnection connect(SocketAddress socketAddress, int readTimeout) throws IOException
{
Socket socket = new Socket();
socket.bind(null);
socket.connect(socketAddress, readTimeout);

return new ActiveConnection(socket, readTimeout);
Expand Down Expand Up @@ -733,7 +735,7 @@ public void setInternalCacheLimit(int internalCacheLimit)
* <p>
* This method is in place so that you can upgrade to a secure connection (usually wrapped around the same socket
* instance).
*
* <p>
* In any case, the remote should also be ready for the change.
*
* @param socket The socket instance.
Expand Down

0 comments on commit 0ffe81f

Please sign in to comment.