I am currently using SmartFoxServer v2.19 with Unity and I am facing a few issues related to reconnection and disconnection. I am trying to handle reconnection based on ping received every 2 seconds. So, if no ping is received every 2 seconds, the client will disconnect itself and try to log in again.
I am facing some issues to accomplish this.
1. On disconnection, SmartFoxServer is trying to reconnect automatically. I am not sure if this is because of HRC+ or anything else but because of this, I am not able to reconnect manually. I want to know how I can disable this auto-reconnect feature or how can I keep both?
2. On disconnection, even when I am not in play mode, I am getting this log every second:
Code: Select all
[SFS - WARN] You are not connected. Request cannot be sent: Sfs2X.Requests.PingPongRequest
UnityEngine.Debug:Log (object)
Sfs2X.Logging.Logger:Log (Sfs2X.Logging.LogLevel,string)
Sfs2X.Logging.Logger:Warn (string[])
Sfs2X.SmartFox:Send (Sfs2X.Requests.IRequest)
Sfs2X.Util.LagMonitor.DefaultLagMonitor:OnPollEvent (object,System.Timers.ElapsedEventArgs)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
This happens even when I am disconnecting the SFS instance manually onApplicationQuit().
Here is the code how I am doing it.
Code: Select all
void OnApplicationQuit()
{
if (sfsInstance != null && sfsInstance.IsConnected)
sfsInstance.Disconnect();
Debug.Log("is connected "+sfsInstance.IsConnected);
}Any help or guidance on these issues would be greatly appreciated.
Thanks.