WebGL disconnect, PlayerTtl, timeout, keep-alive issue

Options
I'm currently working on a WebGL build.
The issue is, sometimes client randomly gets disconnected due to Websocket disconnection.

PlayerTtl = 5000,
EmptyRoomTtl = 10000,

I set these for the room option, still doesn't work.
PhotonNetwork.MaxResendsBeforeDisconnect = 10;
PhotonNetwork.QuickResends = 3;
These are also set, but still gets disconnected within 1-2 seconds if I block my internet connection to the browser (to test).
I'm thinking that the random disconnect will be fixed or alleviated if I can delay the disconnect for the websocket for photon.

Is there any other settings I can check to let this not happen?

Comments

  • Tobias
    Options
    @hiro, a WebSocket connection is using TCP and thus is actually a proper "connection" via the network. The system / network interface detects when a TCP connection is no longer available and will inform the app about it. This results in a quick disconnect.

    Please read the description of the PlayerTTL value, to get an idea of what it does. This time starts after the player disconnected.

    QuickResends and MaxResendsBeforeDisconnect don't apply to TCP / WebSockets. These values are used for reliable UDP connections.
  • hiro
    Options
    Ok, thanks.
    So, for my purpose, how do we extend the keep alive or prevent from accidental disconnect?
    I mean, I got disconnected from my own game 5 times today.
    I have been reading the documentation about Unity specific, where if Unity is loading a scene, it should use the other thread to keep sending ACK? (SendOutgoingCommands), to keep its connection.
    However, my game is WebGL, and if some tab takes too much network, or PC is getting a bit slow, and having a small freeze moments, it often gets disconnected.
    I am adding script that keeps sending ping to the server through javascript if and when the window is in the background, using "PhotonNetwork.NetworkingClient.LoadBalancingPeer.SendAcksOnly();"
    But even this goes through WebGL and if the build is somehow frozen or something happens, it instantly disconnects.

    Is there any way to keep this connection alive somehow?