Skip to content

A send_ping method for measuring latency - #576

Merged
Eugeny merged 1 commit into
Eugeny:mainfrom
moshevds:send_ping
Oct 9, 2025
Merged

A send_ping method for measuring latency#576
Eugeny merged 1 commit into
Eugeny:mainfrom
moshevds:send_ping

Conversation

@moshevds

@moshevds moshevds commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

The already supported send_keepalive method is useful for keeping the connection alive, but when the application wants to measure the latency, we need to wait for the response before returning.

"ping" is a rather basic networking feature, but there is a reason why so many protocols have their own ping utility (arping, ndping, hping, httping, ws-ping, quicreach, etc.). Different networks just need different diagnostic tools.

My personal usecase is that I want to do a latency check - to a host that only serves SSH - through a SOCKS proxy. I cannot send ICMP packets because there is a proxy in between the hosts. I'm sure there are many other diagnostic use cases for this. Perhaps there are also other applications that for some reason want to show the connection latency, like 3D shooters typically can do, for example.

In any case, I think this is a useful feature for russh to have, so here I am proposing it, with this PR.

The already supported send_keepalive method is useful for keeping the
connection alive, but when the application wants to measure the latency,
we need to wait for the response before returning.
@Eugeny
Eugeny merged commit 6878bf1 into Eugeny:main Oct 9, 2025
11 checks passed
@Eugeny

Eugeny commented Oct 9, 2025

Copy link
Copy Markdown
Owner

LGTM, thank you

@Eugeny

Eugeny commented Oct 9, 2025

Copy link
Copy Markdown
Owner

@all-contributors add @moshevds for code

@allcontributors

Copy link
Copy Markdown
Contributor

@Eugeny

I've put up a pull request to add @moshevds! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants