Beispiel #1
0
        public int AsyncRequest(string inMethodName, object[] inParams, GbxCallCallbackHandler callbackHandler)
        {
            GbxCall gbxCall = new GbxCall(inMethodName, inParams)
            {
                Handle = --this.requests
            };
            int num = XmlRpc.SendCall(this.tcpSocket, gbxCall);
            int result;

            lock (this)
            {
                if (num != 0)
                {
                    if (callbackHandler != null)
                    {
                        this.callbackList.Add(num, callbackHandler);
                    }
                    result = num;
                }
                else
                {
                    result = 0;
                }
            }
            return(result);
        }
Beispiel #2
0
        public bool EnableCallbacks(bool inState)
        {
            GbxCall gbxCall = new GbxCall("EnableCallbacks", new object[]
            {
                inState
            })
            {
                Handle = --this.requests
            };

            return(XmlRpc.SendCall(this.tcpSocket, gbxCall) != 0);
        }
Beispiel #3
0
        public GbxCall Request(string inMethodName, object[] inParams)
        {
            this.callRead.Reset();
            GbxCall gbxCall = new GbxCall(inMethodName, inParams)
            {
                Handle = --this.requests
            };
            int num = XmlRpc.SendCall(this.tcpSocket, gbxCall);

            do
            {
                this.callRead.WaitOne();
            }while (this.responses[num] == null && this.tcpSocket.Connected);
            if (!this.tcpSocket.Connected)
            {
                throw new NotConnectedException();
            }
            return(this.GetResponse(num));
        }