Export (0) Print
Expand All

ClientWebSocket.SendAsync Method

.NET Framework 4.5

Send data on ClientWebSocket as an asynchronous operation.

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

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

Parameters

buffer
Type: System.ArraySegment<Byte>

The buffer containing the message to be sent.

messageType
Type: System.Net.WebSockets.WebSocketMessageType

Specifies whether the buffer is clear text or in a binary format.

endOfMessage
Type: System.Boolean

Specifies whether this is the final asynchronous send. Set to true if this is the final send; false otherwise.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token used to propagate notification that this operation should be canceled.

Return Value

Type: System.Threading.Tasks.Task
Returns Task.
The task object representing the asynchronous operation.

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

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft