socket.io-client-csharp icon indicating copy to clipboard operation
socket.io-client-csharp copied to clipboard

about DisconnectAsync

Open babizhu opened this issue 1 year ago • 1 comments

socket.OnPing += (, _) => _lastPingTime = DateTime.Now;

"If _lastPingTime does not receive data for more than 10 seconds, it needs to reconnect. The code is as follows:

 Logger.Info("连续10秒未收到Ping,断开连接");
 _timer.Stop(); // 在断开连接前停止计时器
 await _socket.DisconnectAsync();
await _socket.ConnectAsync();

However, if I unplug the server's network cable, the program will block at await _socket.DisconnectAsync();"

babizhu avatar Jan 22 '24 07:01 babizhu

"In fact, after testing, it takes about 14 minutes for the await _socket.DisconnectAsync(); to complete execution."

babizhu avatar Apr 24 '24 09:04 babizhu