PUN 2 Randomly Disconnecting

Options

Unity version: 2020.3.38

Photon version: Pun: 2.41 Photon lib: 4.1.6.17

Hi. We have couple of games running on PUN 2. Both are turn based games. Game state is updated only through RPCs. One game is running smoothly without any problem. While the other game randomly disconnects from Photon. Photon's "OnDisconnected" is called with following reasons:


Receive issue. State: Connected. Server: 'x.x.x.x' ErrorCode: 10051 SocketErrorCode: NetworkUnreachable Message: Network is

unreachable System.Net.Sockets.SocketException (0x80004005): Network is unreachable

at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int3 2 size, System.Net.Sockets.SocketFlags

socketFlags) [0x00016] in <39d8670c8f6e487fb992d3c14d754584>:0


PUN OnDisconnected() was called by PUN with reason = Exception


PUN OnDisconnected( was called by PUN with reason = ServerTimeout


As we allow matches between friends, all of them need to be in the same region. So, our region is fixed to eu. We have changed it to other regions but still same issue occurs.

This is mostly faced by our QA team residing in India. But our team members in Europe have also faced it but less frequently.


Have contacted Photon via email, they are saying your internet may not be reliable. Try without a VPN if VPN is connected. Change protocol from UDP to TCP or Web Socket Secure.


We are not testing with a VPN. Have changed protocols. Have also used alternative UDP ports (with UDP protocol) but still same disconnections.


Both games are using paid plans with CCU burst. Our CCU have not gone beyond 53 with our plan supporting upto 95 CCU.


Surprising thing is that with exactly the same setup, one game is running fine while the other is facing disconnections. Have tried by creating a new photon app as well but no improvement.


Can anybody help in this matter?

Comments

  • Tobias
    Options

    Network is unreachable is very likely an issue with your connection. It may be triggered by some messages or the frequency of sending, which is why other games don't necessarily run into this issue.

    Definitely try from another network.

    Check the Analyzing Disconnects doc for info to collect and for some solution options.