Open
Description
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();"
Metadata
Metadata
Assignees
Labels
No labels