Subscribe() public method

public Subscribe ( ) : void
return void
Ejemplo n.º 1
0
 public void HandleEC(bool succ, Edge e, Exception x)
 {
     if (succ)
     {
         /*
          * Got the underlying Edge, now do the path protocol
          */
         Channel results = new Channel(1);
         results.CloseEvent += delegate(object q, EventArgs args) {
             try {
                 RpcResult res = (RpcResult)results.Dequeue();
                 object    o   = res.Result;
                 if (o is Exception)
                 {
                     Console.WriteLine(o);
                     throw (o as Exception);
                 }
                 //If we get here, everything looks good:
                 PathEdge pe = new PathEdge(e, LocalPath, RemotePath);
                 //Start sending e's packets into pe
                 pe.Subscribe();
                 ECB(true, pe, null);
             }
             catch (Exception cx) {
                 ECB(false, null, cx);
             }
         };
         //Make sure we hear the packets on this edge:
         e.Subscribe(_pel._pem, null);
         //Now make the rpc call:
         _pel._pem.Rpc.Invoke(e, results, "sys:pathing.create", LocalPath, RemotePath);
     }
     else
     {
         ECB(false, null, x);
     }
 }