Unsolved how to recognize if ip address(es) has changed
LeoC last edited by
I wonder how I can recognize the change of the ip address(es) of my interface.
Since I guess there is no "ip address change event" I need a workaround for this. It would be sufficient to know the number of the assigned ip addresses.
One thing I can imagine would be: using a timer to read all ip addresses every certain period.
But perhaps there is something different I can use. Any ideas?
Qt only provides a QnetworkInterface class, but it doesn't provide the functionality you need.
The only thing you could do is polling, but this is probably a bad idead (performancewise).
I think there is no way around then to use the native OS API.
For example using WinAPI: NotifyAddrChange function should basically do what you want.
Ni.Sumi last edited by
Hi @LeoC ,
I guess, this is what you are looking. Is the IP Address changed when you set the new Connection or wifi / cable changes ?
For both , this signal will work.