If it is a Windows run send application, and the other a Linux run receives the application, more than five minutes without Internet, reconnect the cables, will continue to normal communication,
Use agreement for UDP and RTP,
By setting SO_KEEPALIVE to solve this problem?
CodePudding user response:
Write their own heartbeat, remove network legacy, and constantly try to reconnectCodePudding user response:
No heart, no longer connection,CodePudding user response:
Udp is not face to connect, very strange, explain under Windows binding state of the port and network CARDS disconnect?CodePudding user response:
To disconnect release resources, to establish a socket connectionCodePudding user response:
SO_KEEPALIVE is TCPCodePudding user response:
Server side testing themselves, such as 10 seconds didn't receive any data, withdrew from receiving threads, call closesocket, close the socket, and initialized again, restart the receiving thread, so there would be no problem shouldCall closesocket is key,,,,
CodePudding user response:
You failed to send or receive has failed?Udp is a stateless, keepalvive of udp is invalid,
Who did not even say the problem where you know, look at what's the problem, calling wsagetlasterror not clear!
CodePudding user response:
More than 5 minutes without Internet,UDP send port buffer overflow, can consider to remove a buffer and a socket error sign a try,
The receiver should be no problem,
CodePudding user response:
Offline for 5 minutes, still keep connection1. TCP, yeah, setting SO_KEEPALIVE, how many seconds you can set the TCP socket send a heartbeat packets, you don't have to write their own heartbeat packets,
2. The udp, the concept of no connection,
CodePudding user response:
Connected to the Internet to send for later, and test whether handle has been properly,