Пример #1
0
        public void Will_discard_a_duplicate_incoming_session()
        {
            _peerManager.Init();
            Session session1 = new Session(30303, LimboLogs.Instance, Substitute.For <IChannel>());
            Session session2 = new Session(30303, LimboLogs.Instance, Substitute.For <IChannel>());

            session1.RemoteHost   = "1.2.3.4";
            session1.RemotePort   = 12345;
            session1.RemoteNodeId = TestItem.PublicKeyA;
            session2.RemoteHost   = "1.2.3.4";
            session2.RemotePort   = 12345;
            session2.RemoteNodeId = TestItem.PublicKeyA;

            _rlpxPeer.CreateIncoming(session1, session2);
            _peerManager.ActivePeers.Count.Should().Be(1);
        }
Пример #2
0
        private void CreateIncomingSessions()
        {
            Session[] clone;

            lock (_sessions)
            {
                clone = _sessions.ToArray();
            }

            _rlpxPeer.CreateIncoming(clone);
        }