On Wed, 2019-01-30 at 01:02 +0100, Christof Ressi wrote:
situation and try to avoid to connect to ports, that aren't open ;- )
or ping them first in the command line :-D
ping doesn't help much with testing for open ports. nc (netcat) can be used, but it behaves the same: If it receives no response, it waits for TIMEOUT seconds.
BTW: It depends on the other end's firewall whether a connection attempt fails immediately or only after a while. Firewalls can be configured to REJECT connections to closed ports, which means a notification (ICMP message, probably, I'm not sure) is sent to the initiating party, or the can be configured to DROP connections to closed ports -> no notification is sent. Without notification, the initiating party cannot know whether the receiving end is still processing the request or if it was silently dropped. That's why the default timeouts are so large.
Roman