Share via


HubConnectionBuilder Class

Definition

A builder for configuring HubConnection instances.

public ref class HubConnectionBuilder : Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder, Microsoft::AspNetCore::SignalR::ISignalRBuilder
public class HubConnectionBuilder : Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder, Microsoft.AspNetCore.SignalR.ISignalRBuilder
type HubConnectionBuilder = class
    interface IHubConnectionBuilder
    interface ISignalRBuilder
Public Class HubConnectionBuilder
Implements IHubConnectionBuilder, ISignalRBuilder
Inheritance
HubConnectionBuilder
Implements

Constructors

HubConnectionBuilder()

Initializes a new instance of the HubConnectionBuilder class.

Properties

Services

Gets the builder service collection.

Methods

Build()

Creates a HubConnection.

Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

GetType()

Gets the Type of the current instance.

ToString()

Returns a string that represents the current object.

Extension Methods

ConfigureLogging(IHubConnectionBuilder, Action<ILoggingBuilder>)

Adds a delegate for configuring the provided ILoggingBuilder. This may be called multiple times.

WithAutomaticReconnect(IHubConnectionBuilder, IRetryPolicy)

Configures the HubConnection to automatically attempt to reconnect if the connection is lost.

WithAutomaticReconnect(IHubConnectionBuilder, TimeSpan[])

Configures the HubConnection to automatically attempt to reconnect if the connection is lost.

WithAutomaticReconnect(IHubConnectionBuilder)

Configures the HubConnection to automatically attempt to reconnect if the connection is lost. The client will wait the default 0, 2, 10 and 30 seconds respectively before trying up to four reconnect attempts.

WithKeepAliveInterval(IHubConnectionBuilder, TimeSpan)

Configures KeepAliveInterval for the HubConnection.

WithServerTimeout(IHubConnectionBuilder, TimeSpan)

Configures ServerTimeout for the HubConnection.

WithStatefulReconnect(IHubConnectionBuilder)

Configures the HttpConnectionOptions to negotiate stateful reconnect with the server.

WithUrl(IHubConnectionBuilder, String, HttpTransportType, Action<HttpConnectionOptions>)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL and transports.

WithUrl(IHubConnectionBuilder, String, HttpTransportType)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL and transports.

WithUrl(IHubConnectionBuilder, String, Action<HttpConnectionOptions>)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL.

WithUrl(IHubConnectionBuilder, String)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL.

WithUrl(IHubConnectionBuilder, Uri, HttpTransportType, Action<HttpConnectionOptions>)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL and transports.

WithUrl(IHubConnectionBuilder, Uri, HttpTransportType)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL and transports.

WithUrl(IHubConnectionBuilder, Uri, Action<HttpConnectionOptions>)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL.

WithUrl(IHubConnectionBuilder, Uri)

Configures the HubConnection to use HTTP-based transports to connect to the specified URL.

WithMessagePackProtocol(IHubConnectionBuilder, MessagePackHubProtocolOptions)
WithMessagePackProtocol(IHubConnectionBuilder)
AddMessagePackProtocol(ISignalRBuilder, Action<MessagePackHubProtocolOptions>)

Enables the MsgPack protocol for SignalR and allows options for the MsgPack protocol to be configured.

AddMessagePackProtocol(ISignalRBuilder)

Enables the MsgPack protocol for SignalR.

Applies to