예제 #1
0
 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;
 }
예제 #2
0
 public void Dispose()
 {
     if (receiver != null)
     {
         if (registeredInCloud)
             UnregisterFromCloud();
         receiver.Dispose();
         receiver = null;
     }
 }