Home > Net > Ask: how to deal with when Scoket suddenly?
Ask: how to deal with when Scoket suddenly?
Time:10-01
Due to the complexity of real network condition, before the connection is not stable, I will set a send the UDP packet size, the situation has improved But not ideal, I again set, the timeout is to close the Socket, and then connect to the server So a lot of, after good
Today is out of the With the good, and suddenly it was impossible for the server to the client's message Reopen the application can not connect as well, until I manual reconnection router success
You develop a SOCKET, connection exception encountered generally how to deal with it? How can you ensure that under the condition of a network, the communication for a long time?
CodePudding user response:
You say the udp, also discuss what interrupts don't interrupt, Udp uninterrupted don't interrupt,
CodePudding user response:
Are you a TCP or UDP? These two differences can be as big,
CodePudding user response:
The client not fixed IP, did the client regularly sends a heartbeat package? Don't know how your network is not fixed, or your client multiple network card, if more than one card you need to write good routing, Preach information is good, the file may be you want to get a retransmission,