Brunet.PathELManager.HandleRpc C# (CSharp) Method

HandleRpc() public method

public HandleRpc ( ISender caller, string meth, IList args, object state ) : void
caller ISender
meth string
args IList
state object
return void
    public void HandleRpc(ISender caller, string meth, IList args, object state) {
      if( meth == "create" ) {
        Edge calling_edge = (Edge)((ReqrepManager.ReplyState)caller).ReturnPath;
        string remote_path = (string)args[0];
        string local_path = (string)args[1];
        PathEdgeListener el = _pel_map[local_path];
        if( el.IsStarted ) {
          PathEdge npe = new PathEdge(calling_edge, local_path, remote_path);
          lock( _sync ) {
            //We don't announce yet, wait till we get some data, which
            //verifies that the other side has seen it.
            _unannounced[calling_edge] = npe;
          }
          //So the new Edge has been announced.
          Rpc.SendResult(state, true);
        }
        else {
          throw new Exception(
             String.Format("PathEdgeListener({0}) not started", local_path));
        }
      }
      else {
        throw new AdrException(-32601, "No Handler for method: " + meth);
      }
    }