Ejemplo n.º 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);
        }
Ejemplo n.º 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
            }
        }
Ejemplo n.º 3
0
        public void Invoke(RTMethodRequest methodRequest)
        {
            sentRequests[methodRequest.Id] = methodRequest;

            if (connectionManager.IsConnected())
            {
                MetReq(methodRequest);
            }
            else
            {
                methodsToSend.Enqueue(methodRequest);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 5
0
 public void Invoke(RTMethodRequest methodRequest)
 {
     new Thread(() => rtClient.Invoke(methodRequest)).Start();
 }
Ejemplo n.º 6
0
 public void Invoke(RTMethodRequest methodRequest)
 {
     throw new NoSocketIOException();
 }