예제 #1
0
        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;
        }
예제 #2
0
        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());
            }
        }