Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkirchner/tcping
Check if a desired port is reachable via TCP
https://github.com/mkirchner/tcping
Last synced: 1 day ago
JSON representation
Check if a desired port is reachable via TCP
- Host: GitHub
- URL: https://github.com/mkirchner/tcping
- Owner: mkirchner
- License: mit
- Created: 2016-05-13T10:32:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-01-24T08:22:08.000Z (10 months ago)
- Last Synced: 2024-11-05T12:32:50.511Z (15 days ago)
- Language: C
- Size: 28.3 KB
- Stars: 47
- Watchers: 4
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
TCPING(1) User Manuals TCPING(1)
NAME
tcping - non-blocking TCP connection testSYNOPSIS
tcping [-q] [-f <4|6> ] [-t timeout-sec | -u timeout-usec ] host portDESCRIPTION
tcping attempts to complete a TCP connection to a host:port combination
within the time interval timeout-[u]sec. The result of the operation
is encoded as a return value.OPTIONS
-q Quiet flag. Suppress all informational output.-f <4|6>
IP protocol family to use: 4 for IPv4, 6 for IPv6. If left
unspecifed, the implementation will use the protocol family of
the first record returned from getaddrinfo(3), based on the for-
mat of the host parameter. Specifying host as dotted-decimal
IPv4 or hex IPv6 address string will use the respective protocol
stack. Specification as a hostname character string will cause a
dependency on the order of IPv4 and IPv6 records returned from
getaddrinfo(3).-t timeout-sec
Connection timeout in seconds.-u timeout-usec
Connection timeout in microseconds.host Destination host. Either a host name node name or a numeric host
address string (i.e., a dotted-decimal IPv4 address or an IPv6
hex address), per RFC 2553.port Destination port. Either a service name or a decimal port num-
ber, per RFC 2553.RETURN VALUES
tcping encodes the result of the connection attempt in its return
value:0 The connection attempt was successful.
1 The connection attempt was unsuccessful.
2 The connection attempt timed out.
255 An error occured.
DIAGNOSTICS
Unless the quiet (-q) flag is set, the following diagnostics are issued
on stderr. The messages align with the program return value (see
above).port open.
The connection attempt to host:port was successful.
port closed.
The connection attempt to host:port was unsuccessful and the
server side signaled a closed port.
port user timeout.
The connection attempt to host:port did not complete within the
user-defined timeout interval.AUTHOR
Marc KirchnerHISTORY
tcping came to be in 2002 as a utility to allow basic TCP connection
checking and to enable failure shortcircutry before issuing network
commands with long timeouts (on Solarix 2.x, Solaris 7/8, AIX and
Linux). IPv6 functionality was added for 2.0.0 in 2023, which also
dropped support for the AIX and Solaris OS.ACKNOWLEDGEMENTS
Many thanks to Kai Hambrecht, John Smith and Vincent Loriot.SEE ALSO
nc(1)Linux MARCH 2023 TCPING(1)