Open babizhu opened 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();"
"In fact, after testing, it takes about 14 minutes for the await _socket.DisconnectAsync(); to complete execution."
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:
However, if I unplug the server's network cable, the program will block at await _socket.DisconnectAsync();"