Hosi
Hosi

Reputation: 545

being aware of IP Changes

I'm writing a program that needs to be aware of all IP addresses a machine and the packets are transfered through their connections. I can get the IP list before running of the main program with "gethostbyname", but what if any IP is available after that? Well having a loop with let say 1 minute sleep for each iteration and updating the IP list can help me but it's not accurate and I may lose some of the packages! Is there any other way? I'm using Windows and C++

Thanks

Upvotes: 1

Views: 363

Answers (1)

rene
rene

Reputation: 42494

Not sure on your actual requirements but I would start by calling

NotifyIpInterfaceChange

which is part of the IPHelper API

http://msdn.microsoft.com/en-us/library/aa814450(v=VS.85).aspx

Upvotes: 3

Related Questions