Cannot reconnect after losing connection

Options

Hello all,

I'm my game, if the user's connection drops out, we give them 30s in which to reconnect, at which point we add them back into the room. This work sometimes.

Other times however, once the internet drops out, I get the attached error message and the user does not get reconnected. As far as I can see, Photon makes no attempt to reconnect after this happens. Connect and OnConnected in LoadBalancingClient do not get called (nor any of the other functions I put Logs in).

If I use the SimulateConnectionLoss within the LoadBalancingClient it works fine. When I disconnect using any other method (disabling my internet, pulling out the cable etc), sometimes I get the expected behaviour, sometimes I get this error


Best Answer

  • Ewan_95
    Ewan_95
    Answer ✓
    Options

    This was happening because we weren't correctly handling the very occasional case of the DisconnectCause.None. Strangely though Photon does not clear up when this is the case, LeftRoomCleanUp() is not being called and therefore neither is LocalCleanupAnythingInstantiated(). I might ask another question on this, maybe this has been dealt with in a newer Photon version

Answers

  • Ewan_95
    Ewan_95
    Answer ✓
    Options

    This was happening because we weren't correctly handling the very occasional case of the DisconnectCause.None. Strangely though Photon does not clear up when this is the case, LeftRoomCleanUp() is not being called and therefore neither is LocalCleanupAnythingInstantiated(). I might ask another question on this, maybe this has been dealt with in a newer Photon version