Categories
Linux tcp ping tcping tcping examples

tcping for Linux

tcping does a TCP connect to the given ip/port combination. The user can specify a timeout in seconds. This is useful in shell scripts running in firewalled environments. Often SYNs are just being dropped by firewalls, thus connection establishment will be retried several times (for minutes) until a TCP timeout is reached. With tcping it is possible to check first if the desired port is reachable and then start connection establishment.

Exit codes:

  • -1: an error occured.
  • 0: port is open
  • 1: port is closed
  • 2: user timeout

Syntax: tcping [-q] [-t timeout_sec] [-u timeout_usec]

  • -q : quiet mode, do not output anything (except error messages)
  • -t : timeout in seconds
  • -u : timeout in microseconds

Download tcping for Linux:

tcping runs under Linux, OpenBSD, Solaris 7/8/9, Solaris 2.6, AIX, and maybe others. Just try.

See also:

Categories
tcp ping tcping examples tcping.exe

Ping Over TCP with tcping.exe in Windows

tcping.exe (tcp ping) is a small console application that operates similarly to ‘ping’, however it works over a tcp port. Works with all versions of Windows – Windows 7, Windows Vista, Windows XP, Windows 2008, Windows 2003.

Download tcping.exe.

tcping example:

C:>tcping powercram.com

Probing 216.239.36.21:80/tcp - Port is open - time=26.241ms
Probing 216.239.36.21:80/tcp - Port is open - time=20.022ms
Probing 216.239.36.21:80/tcp - Port is open - time=23.272ms
Probing 216.239.36.21:80/tcp - Port is open - time=24.594ms

Ping statistics for 216.239.36.21:80
     4 probes sent.
     4 successful, 0 failed.
Approximate trip times in milli-seconds:
     Minimum = 20.022ms, Maximum = 26.241ms, Average = 23.532ms

tcping options

C:>tcping
--------------------------------------------------------------
tcping.exe by Eli Fulkerson
Please see http://www.elifulkerson.com/projects/ for updates.
--------------------------------------------------------------
Usage: tcping [-t] [-d] [-i interval] [-n times] server-address [server-port]

         -t   : ping continuously until stopped via control-c
         -n 5 : for instance, send 5 pings
         -i 5 : for instance, ping every 5 seconds
         -d   : include date and time on each line
         -b 1 : enable beeps (1 for on-down, 2 for on-up,
                              3 for on-change, 4 for always)

        If you don't pass server-port, it defaults to 80.



Platform:

  • Win32 Console. Runs on XP, Vista, Windows 7, Windows 2008, etc.

Language:

  • C++ – Makefile included for Visual Studio.

License:

See also: