Ejemplo n.º 1
0
        public void calculate_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            calculate_args args = new calculate_args();

            args.Read(iprot);
            iprot.ReadMessageEnd();
            calculate_result result = new calculate_result();

            try {
                result.Success = iface_.calculate(args.Logid, args.W);
            } catch (InvalidOperation ouch) {
                result.Ouch = ouch;
            }
            oprot.WriteMessageBegin(new TMessage("calculate", TMessageType.Reply, seqid));
            result.Write(oprot);
            oprot.WriteMessageEnd();
            oprot.Transport.Flush();
        }
Ejemplo n.º 2
0
        public void calculate_Process(int seqid, TProtocol iprot, TProtocol oprot)
        {
            calculate_args args = new calculate_args();

            args.Read(iprot);
            iprot.ReadMessageEnd();
            calculate_result result = new calculate_result();

            try
            {
                try
                {
                    result.Success = iface_.calculate(args.Logid, args.W);
                }
                catch (InvalidOperation ouch)
                {
                    result.Ouch = ouch;
                }
                oprot.WriteMessageBegin(new TMessage("calculate", TMessageType.Reply, seqid));
                result.Write(oprot);
            }
            catch (TTransportException)
            {
                throw;
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Error occurred in processor:");
                Console.Error.WriteLine(ex.ToString());
                TApplicationException x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error.");
                oprot.WriteMessageBegin(new TMessage("calculate", TMessageType.Exception, seqid));
                x.Write(oprot);
            }
            oprot.WriteMessageEnd();
            oprot.Transport.Flush();
        }
 public void calculate_Process(int seqid, TProtocol iprot, TProtocol oprot)
 {
   calculate_args args = new calculate_args();
   args.Read(iprot);
   iprot.ReadMessageEnd();
   calculate_result result = new calculate_result();
   try {
     result.Success = iface_.calculate(args.Logid, args.W);
   } catch (InvalidOperation ouch) {
     result.Ouch = ouch;
   }
   oprot.WriteMessageBegin(new TMessage("calculate", TMessageType.Reply, seqid)); 
   result.Write(oprot);
   oprot.WriteMessageEnd();
   oprot.Transport.Flush();
 }