// Notify whoever is interested in NeighborClosed, and start the Maintenance algorithms at threshold
        public virtual void OnNeighborClosed(IPeerNeighbor neighbor)
        {
            if (isOpen)
            {
                lock (ThisLock)
                {
                    if (neighbor != null && neighbor.ListenAddress != null)
                    {
                        EndpointAddress key = neighbor.ListenAddress.EndpointAddress;
                    }

                    if (isOpen && !isRunningMaintenance && neighborManager.ConnectedNeighborCount < config.MinNeighbors)
                    {
                        maintainerTimer.Set(0);
                    }
                }
            }

            NeighborClosedHandler handler = NeighborClosed;

            if (handler != null)
            {
                handler(neighbor);
            }
        }
Ejemplo n.º 2
0
        public virtual void OnNeighborClosed(IPeerNeighbor neighbor)
        {
            if (this.isOpen)
            {
                lock (this.ThisLock)
                {
                    if ((neighbor != null) && (neighbor.ListenAddress != null))
                    {
                        EndpointAddress endpointAddress = neighbor.ListenAddress.EndpointAddress;
                    }
                    if ((this.isOpen && !this.isRunningMaintenance) && (this.neighborManager.ConnectedNeighborCount < this.config.MinNeighbors))
                    {
                        this.maintainerTimer.Set(0);
                    }
                }
            }
            NeighborClosedHandler neighborClosed = this.NeighborClosed;

            if (neighborClosed != null)
            {
                neighborClosed(neighbor);
            }
        }