/// <summary> /// Here we put our actual reconnection logic. The async keyword should always be added since it makes /// things easier for a void return type. /// </summary> /// <param name="reconnectionAttempt">The reconnection attempt wil be given by the session.</param> public async Task PerformReconnection( IReconnectionAttempt reconnectionAttempt ) { ++counter; if ( counter <= 3 ) { // We start the next reconnection attempt reconnectionAttempt.Start(); } else { counter = 0; // We abort any other reconnection attempt and let the session switch to CLOSED_BY_SERVER. reconnectionAttempt.Abort(); } }
/// <summary> /// Here we put our actual reconnection logic. The async keyword should always be added since it makes /// things easier for a void return type. /// </summary> /// <param name="reconnectionAttempt">The reconnection attempt wil be given by the session.</param> public async Task PerformReconnection(IReconnectionAttempt reconnectionAttempt) { ++counter; if (counter <= 3) { // We start the next reconnection attempt reconnectionAttempt.Start(); } else { counter = 0; // We abort any other reconnection attempt and let the session switch to CLOSED_BY_SERVER. reconnectionAttempt.Abort(); } }