AspNetWebSocket.ReceiveAsync(ArraySegment<Byte>, CancellationToken) Método

Definição

Recebe um fragmento de mensagem único de um cliente 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)

Parâmetros

buffer
ArraySegment<Byte>

A matriz que contém os dados da mensagem.The array that contains the message data.

cancellationToken
CancellationToken

O objeto que cancela uma operação pendente.The object that cancels a pending operation.

Retornos

Task<WebSocketReceiveResult>

Uma referência à tarefa de recebimento de uma mensagem.A reference to the task of receiving a message.

Exceções

O objeto AspNetWebSocket foi descartado anteriormente.The AspNetWebSocket object was previously disposed.

O objeto AspNetWebSocket está em um estado anulado.The AspNetWebSocket object is in an aborted state.

- ou --or- As operações de recebimento não estão disponíveis.Receiving operations are unavailable.

Aplica-se a