scribble.rs
scribble.rs copied to clipboard
Extend `keep-alive` message to support round trip time measurements
The keep-alive
message is being used to keep connections between clients and servers open. It would be great to extend it to measure round trip time between connections, which is known as "ping". "Ping" messages could have data attached to them, so clients or servers can identify to which requests they belong to.
How would we even properly implement this when server and client have different times? I guess we'd need a time server?
Wait what, no. We do not need a "time" server. The contained message could be anything random, just to identify from which message it was replied from, therefore making it possible to measure round trip time relaibly.
A starts a stopwatch and sends a message which contains "ABC", B receives message and responses with "ABC". A receives response and stops stopwatch. Measured time can be used for example to display ping.
nvm, i thought of time syncing