public Peer(int port, bool loopbacksAllowed, RsaKeyStore rsaKeyStore) { neighbors = new List<Neighbor>(); broadcastPort = port; peerId = PeerIdentifier.Create(); RsaKeyStore = rsaKeyStore; receiver = new Receiver(port, peerId, loopbacksAllowed) { RsaKeyStore = rsaKeyStore}; receiver.MessageReceived += OnMessageReceived; }
public void Dispose() { if (receiver != null) { if (registeredInCloud) UnregisterFromCloud(); receiver.Dispose(); receiver = null; } }