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); }
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); }
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; } }
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); } }
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; } }
public void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction) { _updatedPeers.Add(new UpdatedPeer(peerId, peerUpdateAction)); }
private void OnPeerUpdated(PeerId peerId, PeerUpdateAction peerUpdateAction) { _transport.OnPeerUpdated(peerId, peerUpdateAction); }
public UpdatedPeer(PeerId peerId, PeerUpdateAction updateAction) { PeerId = peerId; UpdateAction = updateAction; }
public UpdatedPeer(PeerId peerId, PeerUpdateAction action) { PeerId = peerId; Action = action; }