Skip to content

Commit

Permalink
New polling strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
JeppeOvervad committed Sep 28, 2023
1 parent 0bd930e commit 0050fe6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private Map<Integer, Socket> connectClient(final NetworkConfiguration conf)
} catch (ConnectException e) {
// A ConnectionException is expected if the opposing side is not listening for our
// connection attempt yet. We ignore this and try again.
Thread.sleep(1L << ++attempts);
Thread.sleep(Math.min(1 << attempts++, 5_000));
// This should probably not busy-wait for each party
}
}
Expand Down

0 comments on commit 0050fe6

Please sign in to comment.