From 13762a3ee447f3d2e8740a270b137bcdd1ee1b7a Mon Sep 17 00:00:00 2001 From: tox Date: Tue, 9 Apr 2013 10:36:22 +0200 Subject: [PATCH] Applied diff from #44 --- src/io/socket/IOConnection.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/io/socket/IOConnection.java b/src/io/socket/IOConnection.java index 420d0cc..0febf78 100644 --- a/src/io/socket/IOConnection.java +++ b/src/io/socket/IOConnection.java @@ -210,7 +210,7 @@ public void run() { public static void setSslContext(SSLContext sslContext) { IOConnection.sslContext = sslContext; } - + /** * Get the socket factory used for SSL connections. * @@ -484,7 +484,7 @@ private synchronized void resetTimeout() { if (heartbeatTimeoutTask != null) { heartbeatTimeoutTask.cancel(); } - if(getState() != STATE_INVALID) { + if (getState() != STATE_INVALID) { heartbeatTimeoutTask = new HearbeatTimeoutTask(); backgroundTimer.schedule(heartbeatTimeoutTask, closingTimeout + heartbeatTimeout); @@ -863,7 +863,8 @@ private synchronized int getState() { * the new state */ private synchronized void setState(int state) { - this.state = state; + if (getState() != STATE_INVALID) + this.state = state; } /**