Table of Contents

Method ReceiveMessageAsync

Namespace
Sisk.Core.Http.Streams
Assembly
Sisk.Core.dll

ReceiveMessageAsync(CancellationToken)

Receives a message from the WebSocket endpoint asynchronously.

public ValueTask<WebSocketMessage?> ReceiveMessageAsync(CancellationToken cancellation = default)

Parameters

cancellation CancellationToken

The CancellationToken to use for cancellation.

Returns

ValueTask<WebSocketMessage>

A ValueTask<TResult> that represents the asynchronous receive operation, which returns a WebSocketMessage if a message is received; otherwise, null.

ReceiveMessageAsync(TimeSpan)

Receives a message from the WebSocket endpoint asynchronously with a specified timeout.

public ValueTask<WebSocketMessage?> ReceiveMessageAsync(TimeSpan timeout)

Parameters

timeout TimeSpan

The time to wait for a message before timing out.

Returns

ValueTask<WebSocketMessage>

A ValueTask<TResult> that represents the asynchronous receive operation, which returns a WebSocketMessage if a message is received; otherwise, null.

ReceiveMessageAsync()

Receives a message from the WebSocket endpoint asynchronously with a default timeout of 30 seconds.

public ValueTask<WebSocketMessage?> ReceiveMessageAsync()

Returns

ValueTask<WebSocketMessage>

A ValueTask<TResult> that represents the asynchronous receive operation, which returns a WebSocketMessage if a message is received; otherwise, null.