Exemple #1
0
 public bool Process(Serializer iprot, Serializer oprot)
 {
     try
     {
         Message msg = iprot.ReadMessageBegin();
         ProcessFunction fn;
         processMap_.TryGetValue(msg.Name, out fn);
         if (fn == null)
         {
             ProtocolUtil.Skip(iprot, TType.Struct);
             iprot.ReadMessageEnd();
             RPCException x = new RPCException(RPCException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'");
             oprot.WriteMessageBegin(new Message(msg.Name, MessageType.Exception, msg.SeqID));
             x.Write(oprot);
             oprot.WriteMessageEnd();
             oprot.Transport.Flush();
             return true;
         }
         fn(msg.SeqID, iprot, oprot);
     }
     catch (IOException)
     {
         return false;
     }
     return true;
 }
Exemple #2
0
 public void ProcessCall(RPCData.Call call)
 {
     var processCall = processors[call.MethodId].Call;
     if (processCall != null)
     {
         processCall(call);
     }
     else
     {
         SerializerUtil.Skip(call.Data.Serializer, TType.DataObject);
         var response = new RPCData(call.Data, RPCDataType.Exception);
         RPCException x = new RPCException(RPCException.ExceptionType.UnknownMethod, "Invalid method id: '" + call.MethodId + "'");
         response.Serializer.WriteI32(call.Id);
         x.Write(response.Serializer);
         response.Dispatch();
     }
 }
Exemple #3
0
        public void ProcessCall(RPCData.Call call)
        {
            var processCall = processors[call.MethodId].Call;

            if (processCall != null)
            {
                processCall(call);
            }
            else
            {
                SerializerUtil.Skip(call.Data.Serializer, TType.DataObject);
                var          response = RPCData.Create(call.Data, RPCDataType.Exception);
                RPCException x        = new RPCException(RPCException.ExceptionType.UnknownMethod, "Invalid method id: '" + call.MethodId + "'");
                response.Serializer.WriteI32(call.Id);
                x.Write(response.Serializer);
                response.Dispatch();
            }
        }