SuperSocket icon indicating copy to clipboard operation
SuperSocket copied to clipboard

2.0websocket一个必现BUG

Open x0gundam1133 opened this issue 2 years ago • 3 comments

2.0-beta18版本 使用websocket建立连接 ,然后客户端连接完成后通过切换网络再关闭客户端,服务端接收不到客户端断开连接的消息

x0gundam1133 avatar Sep 07 '23 06:09 x0gundam1133

当前使用解决方法通过检测心跳由服务端关闭无效的客户端连接

x0gundam1133 avatar Sep 07 '23 06:09 x0gundam1133

It's not a bug, when your network changes, there is noway to detect the client disconnected. That's why you need implement the heartbeat. The heartbeat is designed to handle this kind of issue https://stackoverflow.com/questions/46111656/must-websockets-have-heartbeats

chucklu avatar Sep 07 '23 07:09 chucklu

Enable clearIdleSession in server side.

kerryjiang avatar Jan 09 '24 19:01 kerryjiang