PhotonNetowrk.Isconnected true, client state: leaving, sometimes gets stuck like this
Options
So normally I am able to leave the room fine by clicking a button, however sometimes we get stuck where we are connected to the network and our client state is leaving, but the client never actually leaves. I then get the following error:
Operation LeaveRoom (254) not called because client is not connected or not ready yet, client state: Leaving
We are connected to the network in this case because the leaveroom will only be called if we are. so why is client state stuck in 'leaving' and yet never actually leaves?
what is the best way to elegantly recover from this? I would say it happens about 1 in 10 times.
any advice appreciated. thanks.
Operation LeaveRoom (254) not called because client is not connected or not ready yet, client state: Leaving
We are connected to the network in this case because the leaveroom will only be called if we are. so why is client state stuck in 'leaving' and yet never actually leaves?
what is the best way to elegantly recover from this? I would say it happens about 1 in 10 times.
any advice appreciated. thanks.
0
Comments
-
Hi @hellohallo,
Thank you for choosing Photon!Operation LeaveRoom (254) not called because client is not connected or not ready yet, client state: Leaving
The first time worked which changed the client state to Leaving and the other call failed with this error.
Maybe the client is not really stuck.
Did you implement OnLeftRoom callback?0 -
Yes I am implementing OnLeftRoom callback and it is getting called normally. The issue only occurs rarely, but I've added some more logging now, so when it happens again I'll have more info. Thanks0
-
is it possible for the client to leave the room but the callback not to be called or would it be called in 100% of cases?
is it possible that the client tries to leave the room but fails? if it is possible what state will it get set to if it tries and fails?0 -
Hi @hellohallo,is it possible for the client to leave the room but the callback not to be called or would it be called in 100% of cases?is it possible that the client tries to leave the room but fails? if it is possible what state will it get set to if it tries and fails?0
-
Ok it happened again, but I didn't have logging to check the return value of LeaveRoom so I've just added that logging and well as logging for the clientstate before and after, so will have a more complete picture next time.Yes, check return value of LeaveRoom method and the logs for errors. The client state does not change in this case.
So if we try and fail to leave the room, the client state will remain as leaving and we will not longer try to leave? Or should the client state be set back to something else if we fail to leave?0