Best way to reconnect to Master Server after timeout?

Hi I would like to know what the best way is to reconnect to the Master Server when the client times out.

Currently I start a coroutine at .OnDisconnected() that calls .Reconnect() every 2 seconds.

This seems to work because when I turn off my internet connection for like 10 seconds the coroutine gets called. When the internet connection is back the .Reconnect() successfully connects me to the Master Server again.

So this solution works, but my question is if this is the suggested solution? Do you guys also use coroutines to reconnect?


Using: Photon PUN 2.4
Sign In or Register to comment.