CodePudding user response:
Then use UDP test underCodePudding user response:
Broken let client automatic reconnection, is TCP protocol? Disconnects the client should also triggered the Close eventSend message to keep the connection way, you can do not regularly from the client to send the service side hair message, so if all data blocks, you should add server,
CodePudding user response:
Regularly check the state condition, close close, close automatically connectCodePudding user response:
Server and the client should be regularly send heartbeat packets verification link is validTCP is long time no news will automatically disconnect routing Settings in the default setting is part of the route
CodePudding user response:
Use the server to the brand licensing, can limit the maximum number of connections n,A) a fixed port used to register the client, the client startup sends a online news, then immediately close the connection, the server received a postscript in the client list,
B) limited n port open to accept the client message,
C) the service side open timer, if there is a free port, is removed from the client list a (according to the circular loop), assigned to a port, send message,
D) the client after receiving the license, the connection port, data can send data, without data online reply, close the connection,
E) server according to the conventional processing data or online reply, marker for free port, enter the step c,
F) the server if after a certain period of time not received reply, concludes that the client is offline, delete from the list, marker for free port, enter the step c,