Пример #1
0
        public PeerManager(ComunicationManager comunicationManager, PeerList peerList, IWorkScheduler worker, BotIdentifier botId)
        {
            _comunicationManager = comunicationManager;
            _comunicationManager.PackageReceivedEventArgs += PackageReceivedEventArgs;
            _worker          = worker;
            _botId           = botId;
            _waitingForReply = new ReplyWaitManager(_comunicationManager);

            _worker.QueueForever(PurgeTimeouts, TimeSpan.FromSeconds(60));
            _peerList = peerList;

            _peerList.BrokenBotDetected += BrokenBotDetected;
        }
Пример #2
0
        public PeerManager(CommunicationManager communicationManager, PeerList peerList, IWorkScheduler worker)
        {
            _communicationManager = communicationManager;
            _communicationManager.PackageReceivedEventArgs += PackageReceivedEventArgs;
            _worker         = worker;
            _peerList       = peerList;
            WaitingForReply = new ReplyWaitManager(_communicationManager, peerList);

            _worker.QueueForever(Ping, TimeSpan.FromMinutes(5));
            _worker.QueueForever(PurgeTimeouts, TimeSpan.FromMinutes(15));

            _peerList.BrokenBotDetected += BrokenBotDetected;
        }