Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about DisconnectAsync #354

Open
babizhu opened this issue Jan 22, 2024 · 1 comment
Open

about DisconnectAsync #354

babizhu opened this issue Jan 22, 2024 · 1 comment

Comments

@babizhu
Copy link

babizhu commented Jan 22, 2024

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
Copy link
Author

babizhu commented Apr 24, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant