示例#1
0
        public DhtBucket(DhtRouting routing, int depth, bool lastBucket)
        {
            Depth      = depth;
            Routing    = routing;
            Last = lastBucket;

            NextRefresh = Routing.Core.TimeNow.AddMinutes(15);
        }
示例#2
0
        public GraphForm(DhtNetwork network)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Network = network;
            Core = Network.Core;
            Routing = Network.Routing;

            Network.UpdateBandwidthGraph += AsyncUpdateGraph;

            Text = "Graph (" + Network.GetLabel() + ")";

            Redraw = true;
        }
示例#3
0
        public CrawlerForm(DhtNetwork network)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Core = network.Core;
            Network = network;
            Routing = Network.Routing;

            Network.CrawlerSearchAck += Receive_SearchAck;
            Network.CrawlerAck  += Receive_CrawlAck;

            Text = "Crawler (" + Network.GetLabel() + ")";

            NodeList.ListViewItemSorter = lvwColumnSorter;
        }
示例#4
0
        public DhtNetwork(OpCore core, bool lookup)
        {
            Core = core;
            IsLookup = lookup;

            Cache = new OpCache(this); // lookup config loads cache entries

            if (IsLookup)
            {
                Core.Context.LookupConfig.Load(this);
                Lookup = Core.Context.LookupConfig;
            }

            Local = new DhtClient();
            Local.UserID = IsLookup ? Lookup.Ports.UserID : Utilities.KeytoID(Core.User.Settings.KeyPublic);
            Local.ClientID = (ushort)Core.RndGen.Next(1, ushort.MaxValue);

            OpID = Utilities.KeytoID(IsLookup ? LookupKey : Core.User.Settings.OpKey);

            OpCrypt = new RijndaelManaged();

            // load encryption
            if (IsLookup)
                OpCrypt.Key = LookupKey;
            else
                OpCrypt.Key = Core.User.Settings.OpKey;

            LocalAugmentedKey = GetAugmentedKey(Local.UserID);

            Protocol = new G2Protocol();
            TcpControl = new TcpHandler(this);
            UdpControl = new UdpHandler(this);
            LanControl = new LanHandler(this);
            RudpControl = new RudpHandler(this);
            LightComm = new LightCommHandler(this);
            UPnPControl = new UPnPHandler(this);

            Routing = new DhtRouting(this);
            Store = new DhtStore(this);
            Searches = new DhtSearchControl(this);
        }
示例#5
0
 public DhtSearchControl(DhtNetwork network)
 {
     Network = network;
     Core = Network.Core;
     Routing = network.Routing;
 }