/** * Asynchronously Invokes the method on the XML-RPC service. */ public void HandleRpc(ISender caller, string method, IList args, object rs) { object[] arg_array = new object[args.Count]; args.CopyTo(arg_array, 0); XmlRpcCallState state = new XmlRpcCallState(_url, method, arg_array, rs); ThreadPool.QueueUserWorkItem(new WaitCallback(BrunetRpc2XmlRpc), state); }
/** * Fires XML-RPC call and gets the job done, then returns Brunet Rpc result. * * Calls to this method come from Brunet, go to XML-RPC and return * to Brunet Overlay. So conversion needed from Adr->XmlRpc.Net->Adr */ public void BrunetRpc2XmlRpc(object xmlrpcCallState) { XmlRpcCallState state = (XmlRpcCallState)xmlrpcCallState; object ret = null; try { ret = state.XmlRpcCall(state.MethodArgs); ret = AdrXmlRpcConverter.XmlRpc2Adr(ret); } catch (Exception e) { Debug.WriteLine(e); ret = new AdrException(-32602, e); } finally { _node.EnqueueAction(new RpcSendResultAction(_rpc, state.RequestState, ret)); } }
/** * Asynchronously Invokes the method on the XML-RPC service. */ public void HandleRpc(ISender caller, string method, IList args, object rs) { object[] arg_array = new object[args.Count]; args.CopyTo(arg_array, 0); XmlRpcCallState state = new XmlRpcCallState(); state.MethodName = method; state.MethodArgs = arg_array; state.RequestState = rs; ThreadPool.QueueUserWorkItem(new WaitCallback(BrunetRpc2XmlRpc), state); }