Commit 6874aaee authored by nanamicat's avatar nanamicat

time

parent 5325b88b
Pipeline #42437 passed with stages
in 2 minutes and 57 seconds
......@@ -57,13 +57,13 @@ async fn main() -> anyhow::Result<()> {
result = socket.recv_from(&mut buf) => {
let (len, addr) = result?;
let now = Instant::now();
let now_timestamp = (start_timestamp + now.duration_since(start)).as_millis() as u32;
tracing::info!("{:?} {:?}", addr, server_addr);
if addr.port() == config.bind.port()
&& let Some(peer) = Router::get(&mut routers, addr)
&& let Ok((hello, _)) = bincode::decode_from_slice(&buf[..len], bincode::config::standard())
{
let now = Instant::now();
let now_timestamp = (start_timestamp + now.duration_since(start)).as_millis() as u32;
peer.on_message(&hello, now, now_timestamp);
} else if addr.port() == config.server.port
&& let Ok((downlink, _)) = bincode::decode_from_slice(&buf[..len], bincode::config::standard())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment