コード例 #1
0
        private void ReceiveAsyncLoop(ReceiveAsyncState receiveState)
        {
receiveAsyncLoopAgain:
            if (receiveState.countToRead > 0)
            {
                receiveEventArgs.SetBuffer(receiveState.byteBuffer.WriteOffset, receiveState.countToRead);
                if (UnderlyingSocket.ReceiveAsync(receiveEventArgs) == false)
                {
                    // completed synchrounsly
                    CompleteReceive(receiveEventArgs, false);
                    goto receiveAsyncLoopAgain;
                }
            }
        }
コード例 #2
0
 public override ValueTask <int> ReceiveAsync(Memory <byte> buffer, CancellationToken cancellationToken = default) =>
 UnderlyingSocket.ReceiveAsync(buffer, SocketFlags.None, cancellationToken);
コード例 #3
0
 public bool ReceiveAsync(SocketAsyncEventArgs args)
 {
     return(UnderlyingSocket.ReceiveAsync(args));
 }