You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using socket.io, when the user closes the application(pause) and then resumes, the old socket is replaced with a new one, and another socket is created also.
Is there some way I could keep the socket in the background?
Or even destroy it before pause?
The text was updated successfully, but these errors were encountered:
Tried that but failed.
The actual websockets are created in the java plugin, right? That's why when app goes to pause they're still alive. If I were to change the plugin and provide an api for getting the active socket, that'd do it?
By default when your app goes to pause the socket will stay open (it should not be closed if it is then there is something wrong going on with the plugin). Have you tried to bind to pause event and close your socket from socket.io:
document.addEventListener("pause",function(){socket.disconnect();// disconnect comes from socket.io api},false);
This should propagate to Java side and close the socket connection.
I'm using socket.io, when the user closes the application(pause) and then resumes, the old socket is replaced with a new one, and another socket is created also.
Is there some way I could keep the socket in the background?
Or even destroy it before pause?
The text was updated successfully, but these errors were encountered: