ClientWebSocket.SendAsync ClientWebSocket.SendAsync ClientWebSocket.SendAsync Method

Definition

Overloads

SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

Send data on ClientWebSocket as an asynchronous operation.

SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken)

SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ArraySegment<Byte>, WebSocketMessageType, Boolean, CancellationToken)

Send data on ClientWebSocket as an asynchronous operation.

public:
 override System::Threading::Tasks::Task ^ SendAsync(ArraySegment<System::Byte> buffer, System::Net::WebSockets::WebSocketMessageType messageType, bool endOfMessage, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task SendAsync (ArraySegment<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken);
override this.SendAsync : ArraySegment<byte> * System.Net.WebSockets.WebSocketMessageType * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

buffer
ArraySegment<Byte>

The buffer containing the message to be sent.

messageType
WebSocketMessageType WebSocketMessageType WebSocketMessageType

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

endOfMessage
Boolean Boolean Boolean

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

cancellationToken
CancellationToken CancellationToken CancellationToken

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

Returns

The task object representing the asynchronous operation.

Remarks

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

Exactly one send and one receive is supported on each ClientWebSocket object in parallel.

SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken) SendAsync(ReadOnlyMemory<Byte>, WebSocketMessageType, Boolean, CancellationToken)

public:
 override System::Threading::Tasks::ValueTask SendAsync(ReadOnlyMemory<System::Byte> buffer, System::Net::WebSockets::WebSocketMessageType messageType, bool endOfMessage, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.ValueTask SendAsync (ReadOnlyMemory<byte> buffer, System.Net.WebSockets.WebSocketMessageType messageType, bool endOfMessage, System.Threading.CancellationToken cancellationToken);
override this.SendAsync : ReadOnlyMemory<byte> * System.Net.WebSockets.WebSocketMessageType * bool * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask

Parameters

endOfMessage
Boolean Boolean Boolean

Returns

Applies to