Beispiel #1
0
 public async Task RemovePeer(AsyncPeer peer, int type, object payload = null)
 {
     if (_peers.TryRemove(peer.PeerId, out _))
     {
         await peer.Send(type, payload).ConfigureAwait(false);
     }
 }
Beispiel #2
0
        public Task RemovePeer(AsyncPeer peer, ReadOnlyMemory <byte> buffer)
        {
            if (_peers.TryRemove(peer.EndPoint.Address, out _))
            {
                return(peer.Send(AsyncTcp.ErrorType, buffer));
            }

            return(Task.CompletedTask);
        }
Beispiel #3
0
 public Task Send(int type, object payload = null)
 {
     return(_peer.Send(type, payload));
 }
Beispiel #4
0
 public Task Send(AsyncPeer peer, int type, ReadOnlyMemory <byte> buffer)
 {
     return(peer.Send(type, buffer));
 }
Beispiel #5
0
 public Task Send(AsyncPeer peer, int type)
 {
     return(peer.Send(type));
 }
Beispiel #6
0
 public Task Send(int type)
 {
     return(_peer.Send(type));
 }