PhotonNetwork.KeepAliveInBackground having no affect

Options
Hi!

PhotonNetwork.KeepAliveInBackground seems to be failing completly in our windows project, using PUN v2.13, Unity version 2018.2.21f1, .Net 4.0, Mono scripting backend.).

No matter what I set it to (or if I leave it to default), our connection times out after the server side 10 seconds is up, so I assume the keep alive thread is not working at all.

We noticed this happens when using a plugin (StandaloneFileBrowser) that opens a native windows file browser (which I think just essentially pauses the unity application while you browse for your file), but I can also make it happen at any time simply by pausing the Unity Editor for 10 seconds.

The error we receive, as you might expect, is...

SocketTcpAsync.EndReceive SocketException. State: Connected. Server: '92.38.154.5' ErrorCode: 10054 SocketErrorCode: ConnectionReset Message: An existing connection was forcibly closed by the remote host.
System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host.

at System.Net.Sockets.Socket.EndReceive (System.IAsyncResult asyncResult) [0x00012] in :0
at ExitGames.Client.Photon.SocketTcpAsync.ReceiveAsync (System.IAsyncResult ar) [0x00023] in :0

Is this a current bug?

Cheers!
Alex.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2019
    Options
    Hi @Alex_P,

    Thank you for choosing Photon!

    You are using WebGL as a target platform? right? and protocol WSS.
    The background thread is not supported on that platform.

    I'm not sure about the Unity Editor though.
    We'll see.
  • Alex_P
    Alex_P
    edited July 2019
    Options
    Hey, thanks for your reply...
    No, not WebGL, its a windows standalone build and I discovered yesterday that it was happening if I used TCP as the protocol. UDP works fine as expected, including in the Editor, but with TCP the keepalive function is failing. For now I'm just going to switch to UDP.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited August 2019
    Options
    Hi @Alex_P,

    Sorry for the delay.

    PUN 2.14 was released lately.
    Could you try if you still have an issue w/ this in TCP or UDP?