Example #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();
        }
Example #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();
        }
Example #3
0
        public int recv_calculate()
        {
            TMessage msg = iprot_.ReadMessageBegin();

            if (msg.Type == TMessageType.Exception)
            {
                TApplicationException x = TApplicationException.Read(iprot_);
                iprot_.ReadMessageEnd();
                throw x;
            }
            calculate_result result = new calculate_result();

            result.Read(iprot_);
            iprot_.ReadMessageEnd();
            if (result.__isset.success)
            {
                return(result.Success);
            }
            if (result.__isset.ouch)
            {
                throw result.Ouch;
            }
            throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "calculate failed: unknown result");
        }
 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();
 }
 public int recv_calculate()
 {
   TMessage msg = iprot_.ReadMessageBegin();
   if (msg.Type == TMessageType.Exception) {
     TApplicationException x = TApplicationException.Read(iprot_);
     iprot_.ReadMessageEnd();
     throw x;
   }
   calculate_result result = new calculate_result();
   result.Read(iprot_);
   iprot_.ReadMessageEnd();
   if (result.__isset.success) {
     return result.Success;
   }
   if (result.__isset.ouch) {
     throw result.Ouch;
   }
   throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "calculate failed: unknown result");
 }