ReceiveAsync Method
Collapse the table of content
Expand the table of content

AspNetWebSocket.ReceiveAsync Method (ArraySegment<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 override Task<WebSocketReceiveResult> ReceiveAsync(
	ArraySegment<byte> buffer,
	CancellationToken cancellationToken
)

Parameters

buffer
Type: System.ArraySegment<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<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:
© 2016 Microsoft