public void helloworld(string who, Action <Exception, string> callback) { var ars = new AsyncRpcSessoin((ex) => { if (ex != null) { callback(ex, default(string)); return(0); } helloworld_result result = new helloworld_result(); result.Read(iprot_); iprot_.ReadMessageEnd(); if (result.__isset.success) { callback(null, result.Success); } else { callback(new TApplicationException(TApplicationException.ExceptionType.MissingResult, "helloworld failed: unknown result"), default(string)); } return(0); }, -1); long sid = Rpc.Instance.AddNewSession(ars); oprot_.WriteMessageBegin(new TMessage("Tutorial:helloworld", TMessageType.Call, sid)); helloworld_args args = new helloworld_args(); args.Who = who; args.Write(oprot_); oprot_.WriteMessageEnd(); oprot_.Transport.ServiceName = service_name_; oprot_.Transport.Flush(); }
public void helloworld_Process(long seqid, TProtocol iprot, TProtocol oprot) { helloworld_args args = new helloworld_args(); args.Read(iprot); iprot.ReadMessageEnd(); helloworld_result result = new helloworld_result(); result.Success = iface_.helloworld(args.Who); oprot.WriteMessageBegin(new TMessage("Tutorial:helloworld", TMessageType.Reply, seqid)); result.Write(oprot); oprot.WriteMessageEnd(); oprot.Transport.Flush(); }