ClientWebSocket.ReceiveAsync ClientWebSocket.ReceiveAsync ClientWebSocket.ReceiveAsync Method

Definition

Overloads

ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken)

Receives data on ClientWebSocket as an asynchronous operation.

ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken)

ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken) ReceiveAsync(ArraySegment<Byte>, CancellationToken)

Receives data on ClientWebSocket as an asynchronous operation.

public:
 override System::Threading::Tasks::Task<System::Net::WebSockets::WebSocketReceiveResult ^> ^ ReceiveAsync(ArraySegment<System::Byte> buffer, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult> ReceiveAsync (ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken);
override this.ReceiveAsync : ArraySegment<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult>

Parameters

buffer
ArraySegment<Byte>

The buffer to receive the response.

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<TResult> object will complete after the receive request on the ClientWebSocket instance has completed.

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

ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken) ReceiveAsync(Memory<Byte>, CancellationToken)

public:
 override System::Threading::Tasks::ValueTask<System::Net::WebSockets::ValueWebSocketReceiveResult> ReceiveAsync(Memory<System::Byte> buffer, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult> ReceiveAsync (Memory<byte> buffer, System.Threading.CancellationToken cancellationToken);
override this.ReceiveAsync : Memory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult>

Parameters

buffer
Memory<Byte>

Returns

Applies to