Share via


HubConnection.Reconnecting Event

Definition

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.

Applies to