[Solved] An IP address is connected or not
I want to find all ip addresses that are connected (in LAN).
I used lookupHost() function explained in this link:
But my application says "Found address:" for all ip addresses!
I glad to hear your ideas.
Thanks a lot.
Hi, you can use ping 192.168.1.1, 192.168.1.2 and so on but it's not 100% because of firewalls, or for a printer or an iPhone because they're sleeping (i.e. an iPhone only answers to ping when the display is lit, unless it has power connected).
Same as for your other question, using the ARP protocol is probably best.
Also you can download the nmap tool.
Hi again & thank a million. :)
In the link that I`ve mentioned in my first post, There is an example.
I replace the QHostInfo::HostNotFound instead of QHostInfo::NoError, but did not work.
Your ideas about ping is very nice, but my applicaion have to be cross-platform with minimum changing of code.
Glad to help!
About why QHostinfo::HostNotFound doesn't work, I think it works but only when you try a DNS name, like www.google.com. I.e. a number like 192.168.61.111 is always "found".
About crossplatform: you can look at that network scanning utility I mentioned before "nmap":http://nmap.org/download.html it comes with source code.
QHostinfo::HostNotFound doesn’t work even for www.google.com.
Lookup failed: "Unknown error"
You`re right. nmap is a good idea for cross-platform application.
English language is not my main language. I dont know which phrase means thank you very very much. But I say thank you very very much. :)
Hello again to all,
I created a dll to find all online IP addresses and their MAC addresses in the LAN. Share with you:
I wrote an article about this topic and posted in CodeProject: