Share via


HubConnection Constructors

Definition

Overloads

HubConnection(IConnectionFactory, IHubProtocol, ILoggerFactory)

Initializes a new instance of the HubConnection class.

HubConnection(IConnectionFactory, IHubProtocol, IServiceProvider, ILoggerFactory)

Initializes a new instance of the HubConnection class.

HubConnection(IConnectionFactory, IHubProtocol, EndPoint, IServiceProvider, ILoggerFactory)

Initializes a new instance of the HubConnection class.

HubConnection(IConnectionFactory, IHubProtocol, EndPoint, IServiceProvider, ILoggerFactory, IRetryPolicy)

Initializes a new instance of the HubConnection class.

HubConnection(IConnectionFactory, IHubProtocol, ILoggerFactory)

Source:
HubConnection.cs
Source:
HubConnection.cs

Initializes a new instance of the HubConnection class.

public:
 HubConnection(Microsoft::AspNetCore::SignalR::Client::IConnectionFactory ^ connectionFactory, Microsoft::AspNetCore::SignalR::Protocol::IHubProtocol ^ protocol, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public HubConnection (Microsoft.AspNetCore.SignalR.Client.IConnectionFactory connectionFactory, Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol protocol, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.SignalR.Client.HubConnection : Microsoft.AspNetCore.SignalR.Client.IConnectionFactory * Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.SignalR.Client.HubConnection
Public Sub New (connectionFactory As IConnectionFactory, protocol As IHubProtocol, loggerFactory As ILoggerFactory)

Parameters

connectionFactory
IConnectionFactory

The IConnectionFactory used to create a connection each time StartAsync(CancellationToken) is called.

protocol
IHubProtocol

The IHubProtocol used by the connection.

loggerFactory
ILoggerFactory

The logger factory.

Applies to

HubConnection(IConnectionFactory, IHubProtocol, IServiceProvider, ILoggerFactory)

Source:
HubConnection.cs
Source:
HubConnection.cs

Initializes a new instance of the HubConnection class.

public:
 HubConnection(Microsoft::AspNetCore::SignalR::Client::IConnectionFactory ^ connectionFactory, Microsoft::AspNetCore::SignalR::Protocol::IHubProtocol ^ protocol, IServiceProvider ^ serviceProvider, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public HubConnection (Microsoft.AspNetCore.SignalR.Client.IConnectionFactory connectionFactory, Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol protocol, IServiceProvider serviceProvider, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.SignalR.Client.HubConnection : Microsoft.AspNetCore.SignalR.Client.IConnectionFactory * Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol * IServiceProvider * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.SignalR.Client.HubConnection
Public Sub New (connectionFactory As IConnectionFactory, protocol As IHubProtocol, serviceProvider As IServiceProvider, loggerFactory As ILoggerFactory)

Parameters

connectionFactory
IConnectionFactory

The IConnectionFactory used to create a connection each time StartAsync(CancellationToken) is called.

protocol
IHubProtocol

The IHubProtocol used by the connection.

serviceProvider
IServiceProvider

An IServiceProvider containing the services provided to this HubConnection instance.

loggerFactory
ILoggerFactory

The logger factory.

Remarks

The IServiceProvider used to initialize the connection will be disposed when the connection is disposed.

Applies to

HubConnection(IConnectionFactory, IHubProtocol, EndPoint, IServiceProvider, ILoggerFactory)

Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs

Initializes a new instance of the HubConnection class.

public:
 HubConnection(Microsoft::AspNetCore::Connections::IConnectionFactory ^ connectionFactory, Microsoft::AspNetCore::SignalR::Protocol::IHubProtocol ^ protocol, System::Net::EndPoint ^ endPoint, IServiceProvider ^ serviceProvider, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public HubConnection (Microsoft.AspNetCore.Connections.IConnectionFactory connectionFactory, Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol protocol, System.Net.EndPoint endPoint, IServiceProvider serviceProvider, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.SignalR.Client.HubConnection : Microsoft.AspNetCore.Connections.IConnectionFactory * Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol * System.Net.EndPoint * IServiceProvider * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.SignalR.Client.HubConnection
Public Sub New (connectionFactory As IConnectionFactory, protocol As IHubProtocol, endPoint As EndPoint, serviceProvider As IServiceProvider, loggerFactory As ILoggerFactory)

Parameters

connectionFactory
IConnectionFactory

The IConnectionFactory used to create a connection each time StartAsync(CancellationToken) is called.

protocol
IHubProtocol

The IHubProtocol used by the connection.

endPoint
EndPoint

The EndPoint to connect to.

serviceProvider
IServiceProvider

An IServiceProvider containing the services provided to this HubConnection instance.

loggerFactory
ILoggerFactory

The logger factory.

Remarks

The IServiceProvider used to initialize the connection will be disposed when the connection is disposed.

Applies to

HubConnection(IConnectionFactory, IHubProtocol, EndPoint, IServiceProvider, ILoggerFactory, IRetryPolicy)

Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs
Source:
HubConnection.cs

Initializes a new instance of the HubConnection class.

public:
 HubConnection(Microsoft::AspNetCore::Connections::IConnectionFactory ^ connectionFactory, Microsoft::AspNetCore::SignalR::Protocol::IHubProtocol ^ protocol, System::Net::EndPoint ^ endPoint, IServiceProvider ^ serviceProvider, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, Microsoft::AspNetCore::SignalR::Client::IRetryPolicy ^ reconnectPolicy);
public HubConnection (Microsoft.AspNetCore.Connections.IConnectionFactory connectionFactory, Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol protocol, System.Net.EndPoint endPoint, IServiceProvider serviceProvider, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.AspNetCore.SignalR.Client.IRetryPolicy reconnectPolicy);
new Microsoft.AspNetCore.SignalR.Client.HubConnection : Microsoft.AspNetCore.Connections.IConnectionFactory * Microsoft.AspNetCore.SignalR.Protocol.IHubProtocol * System.Net.EndPoint * IServiceProvider * Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.AspNetCore.SignalR.Client.IRetryPolicy -> Microsoft.AspNetCore.SignalR.Client.HubConnection
Public Sub New (connectionFactory As IConnectionFactory, protocol As IHubProtocol, endPoint As EndPoint, serviceProvider As IServiceProvider, loggerFactory As ILoggerFactory, reconnectPolicy As IRetryPolicy)

Parameters

connectionFactory
IConnectionFactory

The IConnectionFactory used to create a connection each time StartAsync(CancellationToken) is called.

protocol
IHubProtocol

The IHubProtocol used by the connection.

endPoint
EndPoint

The EndPoint to connect to.

serviceProvider
IServiceProvider

An IServiceProvider containing the services provided to this HubConnection instance.

loggerFactory
ILoggerFactory

The logger factory.

reconnectPolicy
IRetryPolicy

The IRetryPolicy that controls the timing and number of reconnect attempts. The HubConnection will not reconnect if the reconnectPolicy is null.

Remarks

The IServiceProvider used to initialize the connection will be disposed when the connection is disposed.

Applies to