1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 07:15:39 +02:00

[322407][dstore] Connection dropped automatically when idle

This commit is contained in:
David McKnight 2010-09-01 15:21:22 +00:00
parent 416f108acf
commit 843372ee75

View file

@ -19,6 +19,7 @@
* David McKnight (IBM) [246826][dstore] KeepAlive does not work correctly
* David McKnight (IBM) [305218][dstore] problem reading double-byte characters through data socket layer
* David McKnight (IBM) [307541][dstore] fix for Bug 305218 breaks RDz connections
* David McKnight (IBM) [322407][dstore] Connection dropped automatically when idle
*******************************************************************************/
package org.eclipse.dstore.internal.core.util;
@ -328,19 +329,29 @@ public class XMLparser
_initialKart.start();
continue;
}
else if (_initialKart != null && !_initialKart.isAlive())
else if (_initialKart != null)
{
if (!_initialKart.failed())
{
_isKeepAliveCompatible = true;
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive compatible."); //$NON-NLS-1$
_initialKart = null;
if (_initialKart.isAlive()){
int currentTimeout = socket.getSoTimeout();
if (currentTimeout != IO_SOCKET_READ_TIMEOUT){
if (VERBOSE_KEEPALIVE) System.out.println("Resetting timeout from " + currentTimeout + " to " + IO_SOCKET_READ_TIMEOUT); //$NON-NLS-1$ //$NON-NLS-2$
socket.setSoTimeout(IO_SOCKET_READ_TIMEOUT);
}
}
else
{
_isKeepAliveCompatible = false;
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive incompatible."); //$NON-NLS-1$
_initialKart = null;
if (!_initialKart.isAlive()){
if (!_initialKart.failed())
{
_isKeepAliveCompatible = true;
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive compatible."); //$NON-NLS-1$
_initialKart = null;
}
else
{
_isKeepAliveCompatible = false;
if (VERBOSE_KEEPALIVE) System.out.println("KeepAlive incompatible."); //$NON-NLS-1$
_initialKart = null;
}
}
}
}
@ -383,7 +394,7 @@ public class XMLparser
}
}
}
else
else // no keepalive
{
in = reader.read();
}