HubConnectionContext.WriteAsync Method

Definition

Overloads

WriteAsync(HubMessage, CancellationToken)

Write a HubMessage to the connection.

WriteAsync(SerializedHubMessage, CancellationToken)

This method is designed to support the framework and is not intended to be used by application code. Writes a pre-serialized message to the connection.

WriteAsync(HubMessage, CancellationToken)

Write a HubMessage to the connection.

public virtual System.Threading.Tasks.ValueTask WriteAsync (Microsoft.AspNetCore.SignalR.Protocol.HubMessage message, System.Threading.CancellationToken cancellationToken = default);
abstract member WriteAsync : Microsoft.AspNetCore.SignalR.Protocol.HubMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
override this.WriteAsync : Microsoft.AspNetCore.SignalR.Protocol.HubMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Overridable Function WriteAsync (message As HubMessage, Optional cancellationToken As CancellationToken = Nothing) As ValueTask

Parameters

message
HubMessage

The HubMessage being written.

cancellationToken
CancellationToken

Cancels the in progress write.

Returns

ValueTask

A ValueTask that represents the completion of the write. If the write throws this task will still complete successfully.

Applies to

WriteAsync(SerializedHubMessage, CancellationToken)

This method is designed to support the framework and is not intended to be used by application code. Writes a pre-serialized message to the connection.

public virtual System.Threading.Tasks.ValueTask WriteAsync (Microsoft.AspNetCore.SignalR.SerializedHubMessage message, System.Threading.CancellationToken cancellationToken = default);
abstract member WriteAsync : Microsoft.AspNetCore.SignalR.SerializedHubMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
override this.WriteAsync : Microsoft.AspNetCore.SignalR.SerializedHubMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Overridable Function WriteAsync (message As SerializedHubMessage, Optional cancellationToken As CancellationToken = Nothing) As ValueTask

Parameters

message
SerializedHubMessage

The serialization cache to use.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

ValueTask

Applies to