Пример #1
0
        private Emitter MetReq(RTMethodRequest methodRequest)
        {
            Emitter emitter = connectionManager.Socket.Emit("MET_REQ", WeborbSerializationHelper.Serialize(methodRequest.ToArgs()));

            Log.log(Backendless.BACKENDLESSLOG, "metReq called");
            return(emitter);
        }
Пример #2
0
        private void Resubscribe()
        {
            foreach (RTSubscription rtSubscription in subscriptions.Values)
            {
                SubOn(rtSubscription);
            }

            RTMethodRequest methodRequest = null;

#if NET_35
            if (methodsToSend.Count > 0)
            {
                methodRequest = methodsToSend.Dequeue();
            }
#else
            methodsToSend.TryDequeue(out methodRequest);
      #endif

            while (methodRequest != null)
            {
                MetReq(methodRequest);
#if NET_35
                if (methodsToSend.Count > 0)
                {
                    methodRequest = methodsToSend.Dequeue();
                }
#else
                methodsToSend.TryDequeue(out methodRequest);
      #endif
            }
        }
Пример #3
0
        public void Invoke(RTMethodRequest methodRequest)
        {
            sentRequests[methodRequest.Id] = methodRequest;

            if (connectionManager.IsConnected())
            {
                MetReq(methodRequest);
            }
            else
            {
                methodsToSend.Enqueue(methodRequest);
            }
        }
Пример #4
0
        public void UserLoggedIn(string userToken)
        {
            if (connectionManager.IsConnected())
            {
                var rtCallback = new RTCallback <Object>(result =>
                {
                    Log.log(Backendless.BACKENDLESSLOG, "user logged in/out successfully");
                }, error =>
                {
                    Log.log(Backendless.BACKENDLESSLOG, String.Format("got error {0}", error));
                });
                RTMethodRequest methodRequest = new RTMethodRequest(MethodTypes.SET_USER_TOKEN, rtCallback);

                methodRequest.PutOption("userToken", userToken);
                Invoke(methodRequest);
            }
        }
Пример #5
0
 public void Invoke(RTMethodRequest methodRequest)
 {
     new Thread(() => rtClient.Invoke(methodRequest)).Start();
 }
Пример #6
0
 public void Invoke(RTMethodRequest methodRequest)
 {
     throw new NoSocketIOException();
 }