Table of Contents

Method SendAsync

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

SendAsync(string, CancellationToken)

Sends an asynchronous text message to the WebSocket endpoint.

public ValueTask<bool> SendAsync(string message, CancellationToken cancellation = default)

Parameters

message string

The text message to send.

cancellation CancellationToken

The CancellationToken to use for cancellation.

Returns

ValueTask<bool>

A ValueTask<TResult> that represents the asynchronous send operation, which returns true if the message was sent successfully; otherwise, false.

SendAsync(ReadOnlyMemory<byte>, CancellationToken)

Sends an asynchronous binary message to the WebSocket endpoint.

public ValueTask<bool> SendAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellation = default)

Parameters

buffer ReadOnlyMemory<byte>

The binary data to send.

cancellation CancellationToken

The CancellationToken to use for cancellation.

Returns

ValueTask<bool>

A ValueTask<TResult> that represents the asynchronous send operation, which returns true if the message was sent successfully; otherwise, false.