public PeerConnector(PeerNodeConfig config, PeerNeighborManager neighborManager, PeerMaintainer maintainer)
 {
     this.config          = config;
     this.neighborManager = neighborManager;
     this.maintainer      = maintainer;
     this.timerTable      = new Dictionary <IPeerNeighbor, IOThreadTimer>();
     this.state           = State.Created;
 }
Ejemplo n.º 2
0
        public PeerConnector(PeerNodeConfig config, PeerNeighborManager neighborManager,
                             PeerMaintainer maintainer)
        {
            Fx.Assert(config != null, "Config is expected to non-null");
            Fx.Assert(neighborManager != null, "NeighborManager is expected to be non-null");
            Fx.Assert(maintainer != null, "Maintainer is expected to be non-null");
            Fx.Assert(config.NodeId != PeerTransportConstants.InvalidNodeId, "Invalid NodeId");
            Fx.Assert(config.MaxNeighbors > 0, "MaxNeighbors is expected to be non-zero positive value");
            Fx.Assert(config.ConnectTimeout > 0, "ConnectTimeout is expected to be non-zero positive value");

            this.thisLock        = new object();
            this.config          = config;
            this.neighborManager = neighborManager;
            this.maintainer      = maintainer;
            this.timerTable      = new Dictionary <IPeerNeighbor, IOThreadTimer>();
            this.state           = State.Created;
        }