Skip to content

Commit 9cd260c

Browse files
committed
applied diff Gottox#44
1 parent 5060be3 commit 9cd260c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/io/socket/IOConnection.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public void run() {
213213
public static void setSslContext(SSLContext sslContext) {
214214
IOConnection.sslContext = sslContext;
215215
}
216-
216+
217217
/**
218218
* Get the socket factory used for SSL connections.
219219
*
@@ -487,7 +487,7 @@ private synchronized void resetTimeout() {
487487
if (heartbeatTimeoutTask != null) {
488488
heartbeatTimeoutTask.cancel();
489489
}
490-
if(getState() != STATE_INVALID) {
490+
if (getState() != STATE_INVALID) {
491491
heartbeatTimeoutTask = new HearbeatTimeoutTask();
492492
backgroundTimer.schedule(heartbeatTimeoutTask, closingTimeout
493493
+ heartbeatTimeout);
@@ -885,7 +885,8 @@ private synchronized int getState() {
885885
* the new state
886886
*/
887887
private synchronized void setState(int state) {
888-
this.state = state;
888+
if (getState() != STATE_INVALID)
889+
this.state = state;
889890
}
890891

891892
/**

0 commit comments

Comments
 (0)