From eb950f22a7a8d25daa6aa9d28fd62bdee74cf334 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Fri, 28 Jan 2011 21:09:22 +0000 Subject: [PATCH] [282364] [dstore][multithread] timer-threads stay active after disconnect -ammendment --- .../dstore/internal/core/util/XMLparser.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/XMLparser.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/XMLparser.java index 844694d8309..7fa4e798fa6 100644 --- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/XMLparser.java +++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/util/XMLparser.java @@ -329,7 +329,7 @@ public class XMLparser { if (_firstTime) { - _initialKart = new KeepAliveRequestThread(KEEPALIVE_RESPONSE_TIMEOUT, socket); + _initialKart = new KeepAliveRequestThread(KEEPALIVE_RESPONSE_TIMEOUT, socket, true); _firstTime = false; if (VERBOSE_KEEPALIVE) System.out.println("Starting initial KeepAlive thread."); //$NON-NLS-1$ _dataStore.trace("Starting initial KeepAlive thread."); //$NON-NLS-1$ @@ -1124,16 +1124,31 @@ public class XMLparser private long _timeout; private boolean _failed; private Socket _socket; + private boolean _initial; public KeepAliveRequestThread(long timeout, Socket socket) + { + this(timeout, socket, false); + } + + public KeepAliveRequestThread(long timeout, Socket socket, boolean initial) { _timeout = timeout; _failed = false; _socket = socket; + _initial = initial; } public void run() { + if (_initial && !_dataStore.isVirtual()){ + // give the client setup time before requesting + try { + sleep(5000); + } + catch (InterruptedException e){ + } + } _dataStore.sendKeepAliveRequest(); try {