Disconnects Between 3G <-> HSPA <-> 4G <-> W-Fi

Options
Hi,

I have been having seemingly random disocnnects when using mobile data in our game.

Recently I noticed that the disconnects coincide with the mobile connection changing mode. I just had it happen when my signal changed from 4G to HSPA for instance.

I have noticed a similar disconnect when switching from Wi-Fi to mobile data and vice versa.

I found a few posts with similar questions to the above, but they were either from 2013 or went unanswered.

Mobile data connection will often change mode, especially if the player is travelling. It doesn't really seem workable that the player will get disconnected whenever this happens. The connection should have some resilience built in to handle this.

The WiFi to mobile data problem is less of an issue, but it would be great if we could get this working as well.

Any tips on how to accomplish this with the current plugin version? Or am I talking about something new that needs to be implemented?

The mobile data disconnect is a deal breaker. It's making our game feel buggy. We are due to present our vertical slice next week at a conference where mobile data will need to be used, so I need to get this sorted ASAP.

Any and all help appreciated :)

Thanks,

Niall

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2017
    Options
    Hi @nindim,

    I assume the disconnects are caused by timeouts. Please check the DisconnectCause.

    I suggest you try hosting a Photon Server and experiment with server timeout values (how to here and here) and client settings.
    We can't change the values for the public Photon Cloud.
    We can change it for Enterprise Cloud.

    So if this is a big issue for you, I recommend you send us an email to developer at photonengine dot com.
  • nindim
    nindim
    edited July 2017
    Options
    Hi @JohnTube,

    Thanks for the reply.

    I have emailed the address you gave with some extra info and logs.

    You're correct, the disconnect reasons I'm seeing are due to DisconnectByClientTimeout.

    I will post back here if I get any resolution that may help others in the future (if it's not a fix within PUN itself).

    Cheers,

    Niall
  • sorran
    Options
    Hi,

    related to this thread, can you confirm the photon networking recovery behaviour during timeouts... is the socket rebuilt on timeouts + retries, or will the retries occur on the same socket connection until timeout?

    I ask because we have our own socket layer that seems to recover between changing wifi / mobile data but photon layer seems to be failing so I guess our layer is working ok because its doing a full reconnect (which is slower but seems to be safer)

    I guess if you don't rebuild the socket then we need to handle the error, and do a full reconnect and rejoin into the room?

    thanks.
    Andy

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @sorran,

    Thank you for choosing Photon!

    do a full reconnect and rejoin into the room?
    Yes you need to reconnect and rejoin. In PUN there is a helper method that does a shortcut also (with conditions) called ReconnectAndRejoin.