gping icon indicating copy to clipboard operation
gping copied to clipboard

tcp ping feature

Open sanxiago opened this issue 8 months ago • 0 comments

Hello here is a simple Tcp ping feature

Introduces a new pinger using std:net:TcpStream to measure connection time.

Updated pinger library with new tcp::TcpPinger

Added 3 new PingOptions to the pinger library tcping - to use the tcp pinger - default false allow_rst - this is an option to treat connectionRefused as a pong, but the behavior is not always consistent, default false port - default 80 - it would be nice to extend the Target to allow ports, but for simplicity just passing a port

On gping the changes are minimal introduced these arguments, to pass the options when creating the pinger.

  -t, --tcping
          Use TCP pings instead of ICMP
  -r, --no-rst
          Treat RST as a drop (default is to not consider RST as pong)
  -p, --port <PORT>
          TCP port (only used for TCP pings) [default: 80]

Here is how I used it to compare nameserver tcp responses: gping -t 127.0.0.53 1.1.1.1 192.168.2.254 8.8.8.8 -p 53 -n 2

sanxiago avatar Aug 23 '25 01:08 sanxiago