示例#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();
 }