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; } } }
public override ValueTask <int> ReceiveAsync(Memory <byte> buffer, CancellationToken cancellationToken = default) => UnderlyingSocket.ReceiveAsync(buffer, SocketFlags.None, cancellationToken);
public bool ReceiveAsync(SocketAsyncEventArgs args) { return(UnderlyingSocket.ReceiveAsync(args)); }