private void _localDiscovery_PeerDiscovered(LocalPeerDiscovery sender, IPEndPoint peerEP, BinaryID networkID) { lock (_networks) { if (_networks.ContainsKey(networkID)) _networks[networkID].MakeConnection(peerEP); } }
public InternalBitChatService(BitChatService service, BitChatProfile profile, Certificate[] trustedRootCertificates, SecureChannelCryptoOptionFlags supportedCryptoOptions) { _service = service; _profile = profile; _trustedRootCertificates = trustedRootCertificates; _supportedCryptoOptions = supportedCryptoOptions; _connectionManager = new ConnectionManager(_profile.LocalEP, ChannelRequest); LocalPeerDiscovery.StartListener(41733); _localDiscovery = new LocalPeerDiscovery(_connectionManager.LocalEP.Port); _localDiscovery.PeerDiscovered += _localDiscovery_PeerDiscovered; _profile.LocalEP = _connectionManager.LocalEP; }