System.Net.WebSockets.ClientWebSocket.ReceiveAsync Method

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

Syntax

public override System.Threading.Tasks.Task<WebSocketReceiveResult> ReceiveAsync (ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken)

Parameters

buffer
The buffer to receive the response.
cancellationToken
A cancellation token used to propagate notification that this operation should be canceled.

Returns

Returns System.Threading.Tasks.Task`1.

The task object representing the asynchronous operation.

Remarks

This operation will not block. The returned System.Threading.Tasks.Task`1 object will complete after the receive 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