Exemplo n.º 1
0
        public void SendFindNode(byte[] searchedNodeId)
        {
            var msg = _discoveryMessageFactory.CreateOutgoingMessage <FindNodeMessage>(ManagedNode);

            msg.SearchedNodeId   = searchedNodeId;
            _isNeighborsExpected = true;
            _discoveryManager.SendMessage(msg);
            NodeStats.AddNodeStatsEvent(NodeStatsEventType.DiscoveryFindNodeOut);
        }
        public void SendFindNode(byte[] searchedNodeId)
        {
            if (!IsBonded)
            {
                if (_logger.IsDebug)
                {
                    _logger.Debug($"Sending FIND NODE on {ManagedNode} before bonding");
                }
            }

            if (DateTime.UtcNow - _lastTimeSendFindNode < TimeSpan.FromSeconds(60))
            {
                return;
            }

            FindNodeMessage msg = _discoveryMessageFactory.CreateOutgoingMessage <FindNodeMessage>(ManagedNode);

            msg.SearchedNodeId   = searchedNodeId;
            _isNeighborsExpected = true;
            _discoveryManager.SendMessage(msg);
            NodeStats.AddNodeStatsEvent(NodeStatsEventType.DiscoveryFindNodeOut);
        }