net: geometric backoff connection retries on disconnects

This commit is contained in:
William Casarin
2023-12-24 14:23:29 -08:00
parent 6dee4bbe7d
commit f46797ea10
3 changed files with 61 additions and 10 deletions

View File

@@ -115,7 +115,11 @@ fn try_process_event(damus: &mut Damus, ctx: &egui::Context) {
ctx.set_pixels_per_point(ctx.pixels_per_point() - amount);
}
damus.pool.keepalive_ping();
let ctx2 = ctx.clone();
let wakeup = move || {
ctx2.request_repaint();
};
damus.pool.keepalive_ping(wakeup);
// pool stuff
while let Some(ev) = damus.pool.try_recv() {