System.Net.WebSockets.ClientWebSocket.SendAsync Method

Send data on System.Net.WebSockets.ClientWebSocket as an asynchronous operation.

Syntax

public override System.Threading.Tasks.Task SendAsync (ArraySegment<byte> buffer, WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken)

Parameters

buffer
The buffer containing the message to be sent.
messageType
Specifies whether the buffer is clear text or in a binary format.
endOfMessage
Specifies whether this is the final asynchronous send. Set to true if this is the final send; false otherwise.
cancellationToken
A cancellation token used to propagate notification that this operation should be canceled.

Returns

Returns System.Threading.Tasks.Task.

The task object representing the asynchronous operation.

Remarks

This operation will not block. The returned System.Threading.Tasks.Task object will complete after the send request on the System.Net.WebSockets.ClientWebSocket instance has completed.

Requirements

Namespace: System.Net.WebSockets
Assembly: System (in System.dll)
Assembly Versions: 4.0.0.0