AspNetWebSocket.ReceiveAsync Method (ArraySegment(Of Byte), CancellationToken)
.NET Framework (current version)
Receives a single message fragment from a remote client.
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 |
.NET Framework
Available since 4.5
Available since 4.5
Show: