Sisk

Method

HttpWebSocket.ReceiveMessageAsync

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

ReceiveMessageAsync(CancellationToken) #

Receives a message from the WebSocket endpoint asynchronously.

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

Parameters #

cancellation CancellationToken

The CancellationToken to use for cancellation.

Returns #

ValueTask<WebSocketMessage?>

A ValueTask 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.

C#
public ValueTask<WebSocketMessage?> ReceiveMessageAsync(TimeSpan timeout)

Parameters #

timeout TimeSpan

The time to wait for a message before timing out.

Returns #

ValueTask<WebSocketMessage?>

A ValueTask 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.

C#
public ValueTask<WebSocketMessage?> ReceiveMessageAsync()

Returns #

ValueTask<WebSocketMessage?>

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

Type to search the documentation and the API reference.