Timeout with Photon cloud

Hello,

I'm testing my game on a "not so powerfull" pc and the probleme is that the server keeps timeout the client. How can I make sure the connection is kept alive ?

Comments

  • Kaiserludi
    Kaiserludi admin
    edited November 2019
    Hi @benjaml.

    Make sure that you call service() often enough.

    If you don't send any reliable message for a while, then the client will send reliable heartbeats once in a while to tell the server that it is still alive. That only happens when you call service(). If the server does not receive any life-sign from the client at all for 5-10 seconds, then it will consider the client disconnected. This might happen after at least 5 seconds without a life sign and it will happen at max after 10 seconds without a life sign. The exact time is up to the server to decide based on the clients average latency.

    Also make sure that the client can keep up with processing all messages. If it attempts to send to much or does not keep up processing incoming messages fast enough, then reliable messages might time out because they are waiting in the queues to be processed for too long. Again, a server-side timeout will happen, when it does not receive an acknowledgement of receiving it for any reliable message that it has sent to the client within 5-10 seconds. Acknowledgements get sent automatically when the clients processes the incoming messages in service().
    Hence this means that either that "not so powerful" client is not calling service() often enough or that your other clients bombard it with just too many messages for it to be able to process.
  • I have seen the channel in RaiseEventActionOptions, maybe I should use it to avoid my message to hide important message and send it at a lower priority than system message (server heartbeats to chek is the client is still alive)

    Is it something that can be done ?
  • Hi @benjaml.

    All system messages are always sent on a special channel at index -1, which is not available to user messages. Hence they always get the highest priority. This is done exactly to avoid user messages from being able to potentially stall critical system messages.