Home > Mobile > The background why long socket connection will automatically disconnect
The background why long socket connection will automatically disconnect
Time:12-05
Detailed said, the question is this: in a project need to use a socket connection, long now maintain a service as a socket connection to send and receive messages, but the tests found that once the app exit, that has been returned, back to the mobile phone desktop, then the socket have disconnected with four or five minutes or so, heartbeat packets half a minute at a time, the service is running, and then try again but not, only hint even without overtime; If you don't turn off the app interface, press the home key can also be, not completely out of the app, the socket can always send and receive messages, there are two problems have been not sure, one is why the app socket retreated to the background will be broken, what did whether system limit, is another socket disconnect reconnection why even not, is also the service in the background, but once opened the app, because the service is running, so not to create, but this time the socket can be connected... Who have encountered similar or any direction: no, I don't ask baidu ask API documentation can find the solution, no points can be used, such as I brush to fill the
CodePudding user response:
There is no error output reconnection is not
CodePudding user response:
Press the return key, the app's main process was killed, if there is no set service is run in the main process