예제 #1
0
            public void should_forward_peer_update_to_transport(PeerUpdateAction updateAction)
            {
                _directoryMock.Raise(x => x.PeerUpdated += null, _peerUp.Id, updateAction);

                var updatedPeer = _transport.UpdatedPeers.ExpectedSingle();

                updatedPeer.PeerId.ShouldEqual(_peerUp.Id);
                updatedPeer.UpdateAction.ShouldEqual(updateAction);
            }
예제 #2
0
        public void should_proxy_peer_updated_to_inner_transport(PeerUpdateAction updateAction)
        {
            Transport.OnPeerUpdated(AnotherNonPersistentPeer.Id, updateAction);

            var updatedPeer = InnerTransport.UpdatedPeers.ExpectedSingle();

            updatedPeer.PeerId.ShouldEqual(AnotherNonPersistentPeer.Id);
            updatedPeer.UpdateAction.ShouldEqual(updateAction);
        }
예제 #3
0
        public void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction)
        {
            _innerTransport.OnPeerUpdated(peerId, peerUpdateAction);

            if (!peerId.IsPersistence())
                return;

            if (peerUpdateAction == PeerUpdateAction.Started)
            {
                _persistenceIsDown = false;
                ReplayMessagesWaitingForPersistence();
            }
            else if (peerUpdateAction == PeerUpdateAction.Decommissioned)
            {
                _persistenceIsDown = true;
            }
        }
예제 #4
0
        public void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction)
        {
            if (peerId == PeerId)
            {
                return;
            }

            if (peerUpdateAction == PeerUpdateAction.Decommissioned && !peerId.IsPersistence())
            {
                Disconnect(peerId);
            }

            // Forgetting a peer when it starts up make sure we don't have a stale socket for it, at the cost of losing the send buffer safety
            if (peerUpdateAction == PeerUpdateAction.Started)
            {
                Disconnect(peerId, delayed: false);
            }
        }
예제 #5
0
        public void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction)
        {
            _innerTransport.OnPeerUpdated(peerId, peerUpdateAction);

            if (!peerId.IsPersistence())
            {
                return;
            }

            if (peerUpdateAction == PeerUpdateAction.Started)
            {
                _persistenceIsDown = false;
                ReplayMessagesWaitingForPersistence();
            }
            else if (peerUpdateAction == PeerUpdateAction.Decommissioned)
            {
                _persistenceIsDown = true;
            }
        }
예제 #6
0
 public void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction)
 {
     _updatedPeers.Add(new UpdatedPeer(peerId, peerUpdateAction));
 }
예제 #7
0
 public void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction)
 {
     _updatedPeers.Add(new UpdatedPeer(peerId, peerUpdateAction));
 }
예제 #8
0
 private void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction)
 {
     _transport.OnPeerUpdated(peerId, peerUpdateAction);
 }
예제 #9
0
 public UpdatedPeer(PeerId peerId, PeerUpdateAction updateAction)
 {
     PeerId       = peerId;
     UpdateAction = updateAction;
 }
예제 #10
0
 public UpdatedPeer(PeerId peerId, PeerUpdateAction action)
 {
     PeerId = peerId;
     Action = action;
 }
 public UpdatedPeer(PeerId peerId, PeerUpdateAction action)
 {
     PeerId = peerId;
     Action = action;
 }
예제 #12
0
        public void should_proxy_peer_updated_to_inner_transport(PeerUpdateAction updateAction)
        {
            Transport.OnPeerUpdated(AnotherNonPersistentPeer.Id, updateAction);

            var updatedPeer = InnerTransport.UpdatedPeers.ExpectedSingle();
            updatedPeer.PeerId.ShouldEqual(AnotherNonPersistentPeer.Id);
            updatedPeer.UpdateAction.ShouldEqual(updateAction);
        }