From 0ffe81f1628139421b7596f799a9aa434dede6fc Mon Sep 17 00:00:00 2001 From: Veli Tasali Date: Tue, 5 Jan 2021 23:50:00 +0300 Subject: [PATCH] Remove unnecessary socket binding & update docs --- .../monora/coolsocket/core/session/ActiveConnection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/monora/coolsocket/core/session/ActiveConnection.java b/src/main/java/org/monora/coolsocket/core/session/ActiveConnection.java index 441d755..fb72045 100644 --- a/src/main/java/org/monora/coolsocket/core/session/ActiveConnection.java +++ b/src/main/java/org/monora/coolsocket/core/session/ActiveConnection.java @@ -161,6 +161,9 @@ public static ActiveConnection connect(SocketAddress socketAddress) throws IOExc /** * Connects to a CoolSocket server. + *

+ * 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. @@ -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); @@ -733,7 +735,7 @@ public void setInternalCacheLimit(int internalCacheLimit) *

* This method is in place so that you can upgrade to a secure connection (usually wrapped around the same socket * instance). - * + *

* In any case, the remote should also be ready for the change. * * @param socket The socket instance.