doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
715 stars 124 forks source link

about DisconnectAsync #354

Open babizhu opened 5 months ago

babizhu commented 5 months ago

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 commented 2 months ago

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