Comment by jacquesm

Comment by jacquesm 16 hours ago

1 reply

It'd be clever to integrate this into the TCP stack so it tells you immediately what the lowest bound is on the distance to the counterparty based on the time between data sent and the corresponding acknowledgements. I can see some immediate applications for that.

toast0 14 hours ago

You can get tcp measured round trip time from tcp_info with

   struct tcp_info info;
   socklen_t len = sizeof(info);
   getsockopt(sock, IPPROTO_TCP, TCP_INFO, &info, &len);
tcp_info varies by OS and version, but I think tcpi_rtt is well supported.