Expand description
Retry tokio’s TcpListener / UdpSocket bind against a transient
kernel-side bind failure with bounded exponential backoff, while
honouring a tokio_util::sync::CancellationToken so a daemon
shutdown does not hang in the retry loop.
See the README for the motivating use cases (graceful restart,
port-handover dances, lingering TIME_WAIT sockets).
Structs§
- Policy
- Retry parameters shared by
tcpandudp.
Functions§
- sleep_
or_ cancel - Cancel-aware sleep. Returns
trueif cancellation cut the sleep short,falseif the sleep elapsed normally. - tcp
- Bind a
TcpListenerwith exponential backoff and cancellation. - udp
- Bind a
UdpSocketwith exponential backoff and cancellation.