Skip to content

Conversation

@sanxiago
Copy link

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

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.

1 participant