heroiclabs / nakama-unity

Unity client for Nakama server.
https://heroiclabs.com/docs/unity-client-guide
Other
411 stars 75 forks source link

Unity - Request to add socket ping for ISocket #97

Open ernesernesto opened 3 years ago

ernesernesto commented 3 years ago

If we're setting a low sendTimeoutSec for socket, when an app goes into background and went back into foreground (we're using ios), the socket close event won't fire immediately on unity app lifecycle callback.

We need a way to check whether a socket is still valid when application callback from unity called, since on that unity callback, we usually fire an rpc to check for time, online updates, etc. but apparently it would always return cancelled task error if we do it on that callback because the socket is already disconnected, but nakama would fire a close socket callback sometime later

As per discussion with @novabyte on gitter, there should be a way to do a socket ping but it got removed on latest unity client

Thanks