/// <inheritdoc /> public Task StopAsync() { log.Debug("Stopping"); Swarm.ConnectionEstablished -= Swarm_ConnectionEstablished; Swarm.PeerDisconnected -= Swarm_PeerDisconnected; Swarm.RemoveProtocol(this); RemoteTopics.Clear(); localTopics.Clear(); return Task.CompletedTask; }
/// <summary> /// Raised when the peer has no more connections. /// </summary> /// <param name="sender"></param> /// <param name="peer"></param> /// <remarks> /// Removes the <paramref name="peer"/> from the /// <see cref="RemoteTopics"/>. /// </remarks> void Swarm_PeerDisconnected(object sender, Peer peer) { RemoteTopics.Clear(peer); }