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

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

                try {
                    result.Success = iface_.auth(args.Source, args.IdType, args.Username, args.Password);
                } catch (com.imd.common.thrift.ThriftException e) {
                    result.E = e;
                }
                oprot.WriteMessageBegin(new TMessage("auth", TMessageType.Reply, seqid));
                result.Write(oprot);
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
Ejemplo n.º 2
0
            public string recv_auth()
            {
                TMessage msg = iprot_.ReadMessageBegin();

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

                result.Read(iprot_);
                iprot_.ReadMessageEnd();
                if (result.__isset.success)
                {
                    return(result.Success);
                }
                if (result.__isset.e)
                {
                    throw result.E;
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "auth failed: unknown result");
            }