I try to use getaddrinfo()
in my application which should determine whether I am connected to the internet. As long as getaddinfo()
is able to return successfully everything is OK. But as soon as I disconnect my computer from the router the execution of the function fails and takes about 10 seconds.
Is there a solution to fix this or is there a better function to check whether I am connected to the internet or not?
Note: A similar question has already been asked here but disabling the DNSClient service didn't work for me.