AspNetWebSocket.ReceiveAsync(ArraySegment<Byte>, CancellationToken) Method

Definition

Riceve un singolo frammento di messaggio da un client remoto.Receives a single message fragment from a remote client.

public:
 override System::Threading::Tasks::Task<System::Net::WebSockets::WebSocketReceiveResult ^> ^ ReceiveAsync(ArraySegment<System::Byte> buffer, System::Threading::CancellationToken cancellationToken);
public override System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult> ReceiveAsync (ArraySegment<byte> buffer, System.Threading.CancellationToken cancellationToken);
override this.ReceiveAsync : ArraySegment<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocketReceiveResult>
Public Overrides Function ReceiveAsync (buffer As ArraySegment(Of Byte), cancellationToken As CancellationToken) As Task(Of WebSocketReceiveResult)

Parameters

buffer
ArraySegment<Byte>

Matrice che contiene i dati del messaggio.The array that contains the message data.

cancellationToken
CancellationToken

Oggetto che annulla un'operazione in sospeso.The object that cancels a pending operation.

Returns

Task<WebSocketReceiveResult>

Riferimento all'attività di ricezione di un messaggio.A reference to the task of receiving a message.

Exceptions

L'oggetto AspNetWebSocket è già stato eliminato.The AspNetWebSocket object was previously disposed.

L'oggetto AspNetWebSocket si trova in uno stato interrotto.The AspNetWebSocket object is in an aborted state.

-oppure--or- Operazioni di ricezione non disponibili.Receiving operations are unavailable.

Applies to