예제 #1
0
            public void search_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                search_args args = new search_args();

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

                try
                {
                    result.Success = iface_.search(args.Word);
                    oprot.WriteMessageBegin(new TMessage("search", 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("search", TMessageType.Exception, seqid));
                    x.Write(oprot);
                }
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }
예제 #2
0
            public void search_Process(int seqid, TProtocol iprot, TProtocol oprot)
            {
                search_args args = new search_args();

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

                try {
                    result.Success = iface_.search(args.Search);
                } catch (com.imd.common.thrift.ThriftException e) {
                    result.E = e;
                }
                oprot.WriteMessageBegin(new TMessage("search", TMessageType.Reply, seqid));
                result.Write(oprot);
                oprot.WriteMessageEnd();
                oprot.Transport.Flush();
            }