开发者

being aware of IP Changes

开发者 https://www.devze.com 2023-02-15 07:12 出处:网络
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 开发

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消