Exemple #1
0
 /// <summary>Stores data about this hop in a broadcast and provides a path
 /// back to the originating broadcaster.</summary>
 public BroadcastReceiver(BroadcastSender bs)
 {
     Node    = bs.Node;
     From    = bs.From;
     To      = bs.To;
     Source  = bs.Source;
     Hops    = bs.Hops;
     _bs     = bs;
     _sender = new AHSender(Node, Source,
                            AHSender.DefaultTTLFor(Node.NetworkSize),
                            AHHeader.Options.Exact);
 }
        public void HandleData(MemBlock data, ISender return_path, object state)
        {
            MemBlock user_data;
            // Parse BroadcastSender
            BroadcastSender bs = BroadcastSender.Parse(Node, data, out user_data);
            // Present the packet to the local handler
            BroadcastReceiver br = new BroadcastReceiver(bs);

            Node.HandleData(user_data, br, null);
            // Broadcast to the next hop
            bs.Send(user_data);
        }