int08h / roughenough

A Roughtime secure time sync client and server written in Rust
https://int08h.com/post/roughenough-a-rust-roughtime-server/
Apache License 2.0
123 stars 21 forks source link

Properly handle failed writes to clients #34

Closed int08h closed 1 year ago

int08h commented 1 year ago

The "fix" for #33 simply throws away any errors. Instead it should re-attempt delivery in some way.

match socket.send_to(&resp_bytes, &src_addr) {
    Ok(n_bytes) => bytes_sent = n_bytes,
    Err(_) => successful_send = false,
}

Subtlety: retry logic must ensure that the MIDP time of any in-flight response(s) stays within the uncertainty RADI range. Depending on how long we choose to attempt retrying, crafting a entirely new message might be necessary.

Details in #33

int08h commented 1 year ago

Build passed https://github.com/int08h/roughenough/actions/runs/3561434170