HubConnection Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
- 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
ASP.NET Core 2.2 and ASP.NET Core 2.1
Product | Versions |
---|---|
ASP.NET Core | 2.1, 2.2 |
- 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
ASP.NET Core 2.2 and ASP.NET Core 2.1
Product | Versions |
---|---|
ASP.NET Core | 2.1, 2.2 |
- 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.
- 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
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
ASP.NET Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |
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.
- 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
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
ASP.NET Core | 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0 |