private void StoreConnectedPeerTCP(ITcpSocketClient socketClient) { Peer newPeer = new Peer(socketClient, logger); newPeer.MsgReceived += NewPeer_MsgReceived; newPeer.peerStatusChange += NewPeer_peerStatusChange; knownPeers.Add(newPeer); //tell others there is a new peer PeerChange?.Invoke(this, new PeerChangeEventArgs(knownPeers)); }
private void NewPeer_peerStatusChange(object sender, PeerEventArgs e) { Peer changedPeer = e.Peer; //delete inactive peers bool isPeerActive = changedPeer.IsPeerActive; if (!isPeerActive) { //delete from list knownPeers.Remove(changedPeer); } //tell others a peer has been deleted PeerChange?.Invoke(this, new PeerChangeEventArgs(knownPeers)); }
private void PeerManager_PeerChange(object sender, TransportLayer.EventArgs.PeerChangeEventArgs e) { PeerChange?.Invoke(this, e); }
private void BaseStation_PeerChange(object sender, PeerChangeEventArgs e) { PeerChange?.Invoke(this, e); }