Browse Source
Merge pull request #549 from jkohjk/master
fix for underlying connection not closing on ping timeout
master
Nikita Koksharov
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
src/main/java/com/corundumstudio/socketio/handler/ClientHead.java
|
|
@ -125,7 +125,7 @@ public class ClientHead { |
|
|
|
public void run() { |
|
|
|
ClientHead client = clientsBox.get(sessionId); |
|
|
|
if (client != null) { |
|
|
|
client.onChannelDisconnect(); |
|
|
|
client.disconnect(); |
|
|
|
log.debug("{} removed due to ping timeout", sessionId); |
|
|
|
} |
|
|
|
} |
|
|
@ -205,7 +205,9 @@ public class ClientHead { |
|
|
|
|
|
|
|
public void disconnect() { |
|
|
|
ChannelFuture future = send(new Packet(PacketType.DISCONNECT)); |
|
|
|
future.addListener(ChannelFutureListener.CLOSE); |
|
|
|
if(future != null) { |
|
|
|
future.addListener(ChannelFutureListener.CLOSE); |
|
|
|
} |
|
|
|
|
|
|
|
onChannelDisconnect(); |
|
|
|
} |
|
|
|