Skip to content

about DisconnectAsync #354

Open
Open
@babizhu

Description

@babizhu

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions