Match handler match_leave is called with a long delay

Hello,

I’ve been testing the game we’ve been developing on real mobile builds. I have noticed that when the game is suddenly closed, match handler’s match_leave is called instantly, but when I only turn off the wifi and LTE of the running instance, it takes a long time for the match_leave to be called. Maybe that has something to do with the background processes of Android?

We experimented with the ping_period_ms and pong_wait_ms values in the config. They did help a little bit. But they have a threshold. When their values is too small, the clients get in the constant loop of disconnecting and connecting again.

It’s critical for our match handler to notice leaves and joins as soon as possible because it directly affects the gameplay. Are there ways for us to improve this?

Thank you!

Tuning the ping_period_ms and pong_wait_ms is the right way to achieve earlier disconnect detection. If you’re using the Unity SDK, you should also configure the PingPongManager configuration values accordingly to the server’s values to prevent this reconnection behaviour.