Beispiel #1
0
 internal void OnPeerDataReceived(Peer peer, byte[] data)
 {
     _worker.Queue(()=>DataReceived(peer, data));
 }
Beispiel #2
0
 internal void OnPeerDataSent(Peer peer, byte[] data)
 {
     _worker.Queue(()=>DataSent(peer, data));
 }
Beispiel #3
0
 internal void OnClosed(Peer peer)
 {
     _worker.Queue(() => Closed(peer));
 }
Beispiel #4
0
 internal void OnPeerConnected(Peer peer)
 {
     _worker.Queue(()=>Connected(peer));
 }
Beispiel #5
0
 public virtual void DataSent(Peer peer, byte[] data)
 {
 }
Beispiel #6
0
 public virtual void DataReceived(Peer peer, byte[] data)
 {
 }
Beispiel #7
0
 public virtual void Connected(Peer peer)
 {
 }
Beispiel #8
0
 public virtual void Closed(Peer peer)
 {
 }
        private void RegisterPeer(IConnection connection)
        {
            var peer = new Peer(connection);
            _peers.TryAdd(peer.Connection.Endpoint, peer);

            Events.RaiseAsync(PeerConnected, this, new PeerEventArgs(peer));
        }