Exemple #1
0
 public void reset()
 {
     msg  = null;
     id   = 0;
     name = null;
     data = null;
 }
Exemple #2
0
    static void PrintResponse(Google.ProtocolBuffers.IMessage response)
    {
        System.Console.WriteLine("*** Sending response ***");
        string strResponse = response.ToString();

        System.Console.WriteLine(strResponse);
    }
Exemple #3
0
    static void PrintRequest(Google.ProtocolBuffers.IMessage request)
    {
        System.Console.WriteLine("*** Sending request ***");
        string strRequest = request.ToString();

        System.Console.WriteLine(strRequest);
    }
Exemple #4
0
        static internal void CallMethod(
            RcfProtoChannel self,
            Google.ProtocolBuffers.Descriptors.MethodDescriptor method,
            Google.ProtocolBuffers.IRpcController controller,
            Google.ProtocolBuffers.IMessage request,
            Google.ProtocolBuffers.IMessage responsePrototype,
            Action <Google.ProtocolBuffers.IMessage> done)
        {
            self.mResponse      = null;
            self.mResponseError = null;

            self.mDone = done;
            self.mResponsePrototype = responsePrototype;

            // Serialize the request.
            RcfProtoController rcfController = (RcfProtoController)controller;

            if (rcfController != null)
            {
                rcfController.Reset();
                rcfController.mChannel = self;
            }

            string serviceName = method.Service.Name;
            int    methodId    = method.Index;

            byte[] bytes = request.ToByteArray();

            // Hand off to RCF.
            if (self.mSwigCallback == null)
            {
                self.mSwigCallback = new SwigCallback_CallCompletion(self);
            }
            self._CallMethodSwig(serviceName, methodId, bytes, bytes.Length, self.mSwigCallback);

            bool syncRpc = !self.GetAsynchronousRpcMode();

            if (syncRpc)
            {
                if (self.Failed())
                {
                    self.mResponseError = self.ErrorText();
                    throw new System.Exception(self.mResponseError);
                }
            }
        }
Exemple #5
0
    private void PrintRequest(
        Google.ProtocolBuffers.IRpcController controller,
        Google.ProtocolBuffers.IMessage request)
    {
        System.Console.WriteLine("************************");
        System.Console.WriteLine("*** Received request ***");

        RcfProtoController rcfController = (RcfProtoController)controller;
        RcfProtoSession    session       = rcfController.GetSession();

        System.Console.WriteLine("Client username: "******"Compression enabled: " + session.GetEnableCompression());
        System.Console.WriteLine("Transport type: " + session.GetTransportType());
        System.Console.WriteLine("Transport protocol: " + session.GetTransportProtocol());

        string strRequest = request.ToString();

        System.Console.WriteLine("Request:");
        System.Console.WriteLine(strRequest);
    }
Exemple #6
0
 public void setMessage(PBMsg msg)
 {
     this.msg = msg;
 }