Timeout with Photon cloud

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Timeout with Photon cloud

benjaml
2019-11-05 13:26:10

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
2019-11-05 16:14:07

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.

benjaml
2019-11-12 09:18:18

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 ?

Kaiserludi
2019-11-12 15:17:55

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.

Back to top