Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) Deactivating unlimited timeout for persistent connections because this could cause problems with clients which do not shutdown persistent connections properly. - Setting timeout for idle persistent connections to 30 minutes

theli9a2afe88d4b5
diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java
index 39a3ea817..abf1d640a 100644
--- a/source/de/anomic/server/serverCore.java
+++ b/source/de/anomic/server/serverCore.java
@@ -1000,8 +1000,13 @@ public final class serverCore extends serverAbstractThread implements serverThre
*/
} else if (result instanceof Boolean) {
if (((Boolean) result).equals(TERMINATE_CONNECTION)) break;
- // deactivating timeout. this is needed because of persistent connections
- if (!this.controlSocket.isClosed()) this.controlSocket.setSoTimeout(0);
+
+ /*
+ * setting timeout to a very high level.
+ * this is needed because of persistent connection
+ * support.
+ */
+ if (!this.controlSocket.isClosed()) this.controlSocket.setSoTimeout(30*60*1000);
} else if (result instanceof String) {
if (((String) result).startsWith("!")) {
result = ((String) result).substring(1);