On linux IP addresses and ports are tcp devices.
so test ssh to your localhost like so:
--------------------------------------------------------- $ cat</dev/tcp/127.0.0.1/22 SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 ^C $ --------------------------------------------------------