src/packages/EmbedIO/WebSockets/Internal/WebSocket.cs
/// <summary>
/// Asynchronously sends binary data on the WebSocket connection.
/// </summary>
/// <param name="data">An array of <see cref="byte"/>s that represents the binary data to send.</param>
/// <param name="opcode">The opcode.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> that represents the ongoing operation.</returns>
Asynchronously sends binary data on the WebSocket connection.
Asynchronously sends binary data on the WebSocket connection .
public async Task SendAsync(byte[] data, Opcode opcode, CancellationToken cancellationToken = default)
        {
            if (_readyState != WebSocketState.Open)
                throw new WebSocketException(CloseStatusCode.Normal, $"This operation isn\'t available in: {_readyState.ToString()}");
            using var stream = new WebSocketStream(data, opcode, Compression);
            foreach (var frame in stream.GetFrames())
                await Send(frame).ConfigureAwait(false);
        }
public async Task SendAsync ( byte [ ] data , Opcode opcode , CancellationToken cancellationToken = default ) { if ( _readyState != WebSocketState . Open ) throw new WebSocketException ( CloseStatusCode . Normal , $" This operation isn \' t available in:  { _readyState . ToString ( ) } " ) ; using var stream = new WebSocketStream ( data , opcode , Compression ) ; foreach ( var frame in stream . GetFrames ( ) ) await Send ( frame ) . ConfigureAwait ( false ) ; }
Asynchronously sends binary data on the WebSocket connection.
Asynchronously sends binary data on the WebSocket connection .
A  that represents the ongoing operation.
A that represents the ongoing operation .
data
byte[]
An array of s that represents the binary data to send.
An array of s that represents the binary data to send .
opcode
Opcode
None
cancellationToken
CancellationToken
The cancellation token.
The cancellation token .