HubConnection.Reconnected Event
Definition
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.
Occurs when the HubConnection successfully reconnects after losing its underlying connection.
public:
event Func<System::String ^, System::Threading::Tasks::Task ^> ^ Reconnected;
public event Func<string,System.Threading.Tasks.Task> Reconnected;
public event Func<string?,System.Threading.Tasks.Task>? Reconnected;
member this.Reconnected : Func<string, System.Threading.Tasks.Task>
Public Event Reconnected As Func(Of String, Task)
Event Type
Examples
The following example attaches a handler to the Reconnected event, and checks the provided argument to log the ConnectionId.
connection.Reconnected += (connectionId) =>
{
Console.WriteLine($"Connection successfully reconnected. The ConnectionId is now: {connectionId}");
};
Remarks
The String parameter will be the HubConnection's new ConnectionId or null if negotiation was skipped.