Skip to content

Commit

Permalink
fix: moved reconnect_attempts inside check max_reconnect_attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
veerapatyok authored and 1c3t3a committed Jun 26, 2023
1 parent 69b5967 commit 3bb69a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion socketio/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3bb69a2

Please sign in to comment.