HubConnection.Reconnecting 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 starts reconnecting after losing its underlying connection.
public:
event Func<Exception ^, System::Threading::Tasks::Task ^> ^ Reconnecting;
public event Func<Exception,System.Threading.Tasks.Task> Reconnecting;
public event Func<Exception?,System.Threading.Tasks.Task>? Reconnecting;
member this.Reconnecting : Func<Exception, System.Threading.Tasks.Task>
Public Event Reconnecting As Func(Of Exception, Task)
Event Type
Examples
The following example attaches a handler to the Reconnecting event, and checks the provided argument to log the error.
connection.Reconnecting += (exception) =>
{
Console.WriteLine($"Connection started reconnecting due to an error: {exception}");
};
Remarks
The Exception that occurred will be passed in as the sole argument to this handler.