diff --git a/socketio/src/client/client.rs b/socketio/src/client/client.rs index 641a8dbf..53491d4b 100644 --- a/socketio/src/client/client.rs +++ b/socketio/src/client/client.rs @@ -173,11 +173,11 @@ impl Client { if reconnect { loop { if let Some(max_reconnect_attempts) = max_reconnect_attempts { + reconnect_attempts += 1; if reconnect_attempts > max_reconnect_attempts { break; } } - reconnect_attempts += 1; if let Some(backoff) = self.backoff.next_backoff() { std::thread::sleep(backoff);