AspNetWebSocket.ReceiveAsync Method (ArraySegment(Of Byte), CancellationToken)

.NET Framework (current version)
 

Receives a single message fragment from a remote client.

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

Public Overrides Function ReceiveAsync (
	buffer As ArraySegment(Of Byte),
	cancellationToken As CancellationToken
) As Task(Of WebSocketReceiveResult)

Parameters

buffer
Type: System.ArraySegment(Of Byte)

The array that contains the message data.

cancellationToken
Type: System.Threading.CancellationToken

The object that cancels a pending operation.

Return Value

Type: System.Threading.Tasks.Task(Of WebSocketReceiveResult)

A reference to the task of receiving a message.

Exception Condition
ObjectDisposedException

The AspNetWebSocket object was previously disposed.

System.InvalidOperationException

The AspNetWebSocket object is in an aborted state.

-or-

Receiving operations are unavailable.

.NET Framework
Available since 4.5
Return to top
Show: