コード例 #1
0
ファイル: TraceRpcHandler.cs プロジェクト: pstjuste/brunet
 /**
  * This dispatches the particular methods this class provides
  */
 public void HandleRpc(ISender caller, string method, IList args, object req_state) {
   if( method == "GetRttTo" ) {
     ISender dest = new AHGreedySender(_node, AddressParser.Parse((string)args[0]));
     EchoSendHandler esh = new EchoSendHandler(_node, dest, req_state);
     //This will be garbage collected after the request is done:
     esh.SendEchoRequest();
   } else if ( method == "GetRouteTo" ) {
     DoTraceRouteTo( (AHAddress)AddressParser.Parse((string)args[0]), req_state);
   } else if ( method == "RecursiveCall" ) {
     RecursiveCall(args, req_state);
   }
   else {
     throw new AdrException(-32601, "No Handler for method: " + method);
   }
 }
コード例 #2
0
 /**
  * This dispatches the particular methods this class provides
  */
 public void HandleRpc(ISender caller, string method, IList args, object req_state)
 {
     if (method == "GetRttTo")
     {
         ISender         dest = new AHGreedySender(_node, AddressParser.Parse((string)args[0]));
         EchoSendHandler esh  = new EchoSendHandler(_node, dest, req_state);
         //This will be garbage collected after the request is done:
         esh.SendEchoRequest();
     }
     else if (method == "GetRouteTo")
     {
         DoTraceRouteTo((AHAddress)AddressParser.Parse((string)args[0]), req_state);
     }
     else if (method == "RecursiveCall")
     {
         RecursiveCall(args, req_state);
     }
     else
     {
         throw new AdrException(-32601, "No Handler for method: " + method);
     }
 }