Thanks a lot to rvk and Jurassic Pork for your help.
what kind of target hartmut want to check ?
For the long run I would like to have a common general PING feature, because I guess I can use this in several projects.
In my
current project I want to create a
common test function (for various projects) to check, if internet is available, to be able, to write a dedicated error message in my programs, if not.
For this I wanted to use above PING feature to check 1) for some common IP-adresses (e.g. 37.97.187.115 - because they don't need a working DNS-Server) and 2) after that check some common websites (e.g. lazarus.freepascal.org) to check for a working DNS-Server too.
I tested the demo from Jurassic Pork (many thanks for that) and on the 1st view it works.
But I tested it with 2 FTP servers and it returned "Server is unreachable", but both are available via /usr/bin/ping. In one project I want to test via "ping" for these FTP servers (e.g. before I try to connect to them).
And you used '443' as port. Is this value
always to use for everything? Or are there cases, where another value must be used?
Sorry, I'm a bloody beginner to this network stuff and my knowledge about "ports" is near zero.