How to ping an ip address and port with Qt
-
This question was already asked recently, please search in the forum.
As far as I know ping is something special and cannot be done easily (it is not Qt issue).
Most probably you will have to use QProcess with ping command or something else.
Depending on what is listening on that IP/port you could send a request and wait for the response and measure the time? -
-
How can I ping an i address and port using Qt without using QProcess?
As @jsulm remarked, you can't. Ping is part of ICMP and is a low-level protocol (under the TCP/IP stack), so it's not accessible through Qt means.
I want to know if the ip:port is online and how long (in ms) it takes to respond.
You can try opening the port directly instead. See
QTcpSocket
orQUdpSocket
(depending on the listening application) for inspiration.