AspNetWebSocket::ReceiveAsync Method (ArraySegment<Byte>, CancellationToken)
.NET Framework (current version)
Receives a single message fragment from a remote client.
Assembly: System.Web (in System.Web.dll)
public: virtual Task<WebSocketReceiveResult^>^ ReceiveAsync( ArraySegment<unsigned char> buffer, CancellationToken cancellationToken ) override
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 |
.NET Framework
Available since 4.5
Available since 4.5
Show: