Example #1
0
        private void SendAsyncLoop(SendAsyncState sendState)
        {
sendAsyncLoopAgain:
            if (sendState.countToWrite > 0)
            {
                sendEventArgs.SetBuffer(sendState.byteBuffer.ReadOffset, sendState.countToWrite);
                if (UnderlyingSocket.SendAsync(sendEventArgs) == false)
                {
                    // completed synchrounsly
                    CompleteSend(sendEventArgs, false);
                    goto sendAsyncLoopAgain;
                }
            }
        }
Example #2
0
 public override ValueTask <int> SendAsync(ReadOnlyMemory <byte> buffer, CancellationToken cancellationToken = default) =>
 UnderlyingSocket.SendAsync(buffer, SocketFlags.None);
 public bool SendAsync(SocketAsyncEventArgs args)
 {
     return(UnderlyingSocket.SendAsync(args));
 }