How to check an ip address of network interface is accessible to network(not internet)
-
I use QNetworkInterface::allInterfaces() to get all entry ip addresses. They will be used in an app. The app will crash if they are gone(network disconnected). Is there a way to check if the ip address is accessible to network(not internet) in advance while disconnection can happen at any time and it is not efficient to refresh all interfaces more frequently?
-
@JoeCFD said in How to check an ip address of network interface is accessible to network(not internet):
QNetworkInterface
QNetworkInformation perhaps?
-
@JoeCFD said in How to check an ip address of network interface is accessible to network(not internet):
The app will crash if they are gone(network disconnected).
Why should it crash? I would say you should fix your code.
-
@JoeCFD said in How to check an ip address of network interface is accessible to network(not internet):
The app will crash if they are gone(network disconnected).
Why should it crash? I would say you should fix your code.
-
@JoeCFD said in How to check an ip address of network interface is accessible to network(not internet):
QNetworkInterface
QNetworkInformation perhaps?
-
@JoeCFD said in How to check an ip address of network interface is accessible to network(not internet):
That is for Qt6. I am still using 5.15
-
@JoeCFD said in How to check an ip address of network interface is accessible to network(not internet):
That is for Qt6. I am still using 5.15
@Christian-Ehrlicher It is being used to get all interfaces. A timer can be applied to update these interfaces. However, network disconnection can happen at any time.