WebSocket.ReceiveAsync 메서드

정의

오버로드

ReceiveAsync(ArraySegment<Byte>, CancellationToken)

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

ReceiveAsync(Memory<Byte>, CancellationToken)

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>

매개 변수

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.

반환

비동기 작업(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)

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>

매개 변수

buffer
Memory<Byte>
cancellationToken
CancellationToken

반환

적용 대상