Skip to content

Commit 0ffe81f

Browse files
committed
Remove unnecessary socket binding & update docs
1 parent 656ab47 commit 0ffe81f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/monora/coolsocket/core/session/ActiveConnection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ public static ActiveConnection connect(SocketAddress socketAddress) throws IOExc
161161

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

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

0 commit comments

Comments
 (0)