private void Reconnect() { if (socket == null) { return; } Disconnect(); int retryConnectTimeout = timeoutManager.NextTimeout(); Log.log(Backendless.BACKENDLESSLOG, String.Format("Wait for {0} before reconnect", retryConnectTimeout)); Thread.Sleep(retryConnectTimeout); ReconnectAttempt(timeoutManager.RepeatedTimes(), retryConnectTimeout); var tempSocket = Socket; }
internal String Lookup() { try { String rtServer = Invoker.InvokeSync <String>("com.backendless.rt.RTService", "lookup", new Object[] { }); return(rtServer); } catch (System.Exception e) { Log.log(Backendless.BACKENDLESSLOG, String.Format("Lookup failed {0}", e)); int retryTimeout = timeOutManager.NextTimeout(); Log.log(Backendless.BACKENDLESSLOG, String.Format("Wait before lookup for {0}", retryTimeout)); Thread.Sleep(retryTimeout); reconnectAttemptListener?.Invoke(new ReconnectAttempt(timeOutManager.RepeatedTimes(), retryTimeout, e.ToString())); return(Lookup()); } }