Hi,
i'm trying to detect the connection lost on the client side because of being idle for too long. I logged into my app fine ten wait around 15s (i set it up short for testing) and the server disconnect me as expected. On the client i never get the CONNECTION_LOST event fired, should i listen to another one ?
Thanks!
Connection lost after idle
Re: Connection lost after idle
The event should be absolutely be fired.
Can you give me more details? API version, server version, testing platform...
Are you testing locally?
Can you give me more details? API version, server version, testing platform...
Are you testing locally?
Re: Connection lost after idle
Right now im testing locally with the 2.9.0 version
i do something like this first :
then :
but the OnConnectionLost never get called.
But it seems to happen online too, the program should send the user back to the login page when OnConnectionLost is called but when i idle too long on the online app i just get stuck with an unresponsive app (same behavior as when i test locally and idle)
i do something like this first :
Code: Select all
smartFox.AddEventListener(SFSEvent.CONNECTION, OnConnection);
smartFox.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
smartFox.AddLogListener(LogLevel.DEBUG, OnDebugMessage);
smartFox.Connect(serverName, serverPort);Code: Select all
public void OnConnectionLost(BaseEvent evt)
{
string error = (string)evt.Params["error"];
Debug.Log("OnConnectionLost !!!! " + " (error : <" + error + ">)");
UnregisterSFSSceneCallbacks();
LostConnection();
}
But it seems to happen online too, the program should send the user back to the login page when OnConnectionLost is called but when i idle too long on the online app i just get stuck with an unresponsive app (same behavior as when i test locally and idle)
Re: Connection lost after idle
Found out the problem, i had a "SFSManagerController.smartFox.RemoveAllEventListeners();" hiding somewhere... So it seems fine now thx !