-
Notifications
You must be signed in to change notification settings - Fork 1.3k
tcp客户端掉线之后,怎么重连? #692
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
Comments
see TcpClient_test.cpp |
channel->setKeepaliveTimeout(10 * 60 * 1000); //10分钟无数据交互会自动断开重新连接 |
楼上说的setReconnect在正常情况下也是会自动重连。 |
#631 |
这句话是不是写在onConnection回调函数里面? 我实测了一下,放在这里,5s之后是自动断开了。但是没有自动重新连接,得用户自己手动重新连接。 |
配合着setReconnect一块用。 |
ok,亲测可用了 |
tcp客户端掉线之后,怎么重连?
能否写个例程出来?
谢谢
The text was updated successfully, but these errors were encountered: