C
You're viewing a free preview. Sign in free to read every script.
Why this exists "Is the database port reachable?" is the first question in most outages. A plain blocking connect() can hang for minutes when a firewall drops packets silently, which is useless in a health check. The…
A TCP Port Checker with Sockets, Non-Blocking Connect and Timeouts
Check whether host:port accepts connections using getaddrinfo (IPv4 and IPv6), a non-blocking connect with poll for a real timeout, and SO_ERROR to read the outcome. What nc -z does under the hood.
Sign in free to read this script, along with the rest of the library.
Sign in free