Everybody encountered such a problem? Help to think about here may be a problem
CodePudding user response:
After disconnecting, want to shut off the socket, then reconnection,CodePudding user response:
If it is abnormal disconnection, server-side link state and normal state, the client focus on the new link, require explicit Colse/Free socket, can use Wireshark to look at specific network behaviorCodePudding user response:
The service side shall have the ability to identify and connection state management, such as active bolt on a regular basis, with the user do not allow the reconnection,If the server service only one client, consider exclusion method, there is a connection to accept new connections out old connection,
CodePudding user response:
When the client disconnects, the service side should not disconnect, belong to the state of half a connection, should wait after the server disconnected in the reconnection,CodePudding user response:
The client is relatively fixed,Often connect + heartbeat packets + client identification + client automatic reconnection
Such solution resources occupy less, reliable operation,