The socket io connection is always offline.

recently made an app, that uses socket io to make a long connection, which sometimes appears. After the connection, it keeps dropping online. I would like to ask if the Great God has ever encountered such a problem.? What should be done? Or is there a solution?

Apr.07,2021

is it a server-side or client-side problem?

if the server actively disconnects the link due to the inactivity of the client, the client can send heartbeat packets at regular intervals to solve the problem.

if the client network is unstable, you need to write the reconnection mechanism on the client.

Menu