WebSocket.ReceiveAsync 메서드

정의

오버로드

ReceiveAsync(ArraySegment<Byte>, CancellationToken)

WebSocket 연결에서 데이터를 비동기적으로 받습니다.Receives data from the WebSocket connection asynchronously.

ReceiveAsync(Memory<Byte>, CancellationToken)

WebSocket 연결에서 데이터를 비동기적으로 받습니다.Receives data from the WebSocket connection asynchronously.

ReceiveAsync(ArraySegment<Byte>, CancellationToken)

WebSocket 연결에서 데이터를 비동기적으로 받습니다.Receives data from the WebSocket connection asynchronously.

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

매개 변수

buffer
ArraySegment<Byte>

받은 데이터에 대한 스토리지 위치인 애플리케이션 버퍼를 참조합니다.References the application buffer that is the storage location for the received data.

cancellationToken
CancellationToken

작업을 취소해야 한다는 알림을 전파합니다.Propagates the notification that operations should be canceled.

반환

Task<WebSocketReceiveResult>

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.The task object representing the asynchronous operation. 작업 개체의 Result 속성은 수신된 데이터를 나타내는 WebSocketReceiveResult 개체를 반환합니다.The Result property on the task object returns a WebSocketReceiveResult object that represents the received data.

설명

이 작업은 차단 되지 않습니다.This operation will not block. 반환 된 Task<TResult> 개체는에서 데이터를 받은 후에 완료 됩니다 WebSocket .The returned Task<TResult> object will complete after the data has been received on the WebSocket.

각 개체에서 정확히 한 번의 송신 및 수신이 지원 됩니다 WebSocket .Exactly one send and one receive is supported on each WebSocket object in parallel.

적용 대상

ReceiveAsync(Memory<Byte>, CancellationToken)

WebSocket 연결에서 데이터를 비동기적으로 받습니다.Receives data from the WebSocket connection asynchronously.

public:
 virtual System::Threading::Tasks::ValueTask<System::Net::WebSockets::ValueWebSocketReceiveResult> ReceiveAsync(Memory<System::Byte> buffer, System::Threading::CancellationToken cancellationToken);
public virtual System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult> ReceiveAsync (Memory<byte> buffer, System.Threading.CancellationToken cancellationToken);
abstract member ReceiveAsync : Memory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult>
override this.ReceiveAsync : Memory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.Net.WebSockets.ValueWebSocketReceiveResult>
Public Overridable Function ReceiveAsync (buffer As Memory(Of Byte), cancellationToken As CancellationToken) As ValueTask(Of ValueWebSocketReceiveResult)

매개 변수

buffer
Memory<Byte>

받은 데이터에 대한 스토리지 위치인 애플리케이션 버퍼입니다.The application buffer that is the storage location for the received data.

cancellationToken
CancellationToken

수신 작업을 취소할 때 사용하는 취소 토큰입니다.The cancellation token to use to cancel the receive operation.

반환

ValueTask<ValueWebSocketReceiveResult>

비동기 작업(operation)을 나타내는 작업(task) 개체입니다.The task object representing the asynchronous operation. 작업 개체의 Result 속성은 수신된 데이터를 나타내는 ValueWebSocketReceiveResult 개체를 반환합니다.The Result property on the task object returns a ValueWebSocketReceiveResult object that represents the received data.

적용 대상