System.Net.WebSockets.WebSocket.SendAsync Method

Sends data over the WebSocket connection asynchronously.

Syntax

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

Parameters

buffer
The buffer to be sent over the connection.
messageType
Indicates whether the application is sending a binary or text message.
endOfMessage
Indicates whether the data in “buffer” is the last part of a message.
cancellationToken
The token that propagates the notification that operations 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 data has been sent on the WebSocket.

Requirements

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