简体   繁体   中英

Qt. How to view other computers on the network using QtNetwork?

I need to get all PCs IP-adresses in my local network. How should I properly do that if I can using QtNetwork ? I tired use

QNetworkInterface::allAddresses();
QNetworkInterface::allInterfaces();

but it's definently not what I need.

PS

I need get IP's to able connect to some Postgresql servers, is there some Postgresql driver features maybe to make things easier?

What you need is called "Network discovery". There's a lot of different approaches each dedicated to a specific subdomain. The approach of the lower level is called ARP, Address Resolution Protocol see a nice tutorial eg here http://tournasdimitrios1.wordpress.com/2011/01/26/discover-your-local-network-with-arp-scan-on-linux/ . If you need a service discovery then you probably should go with ZeroConf & friends http://doc.qt.digia.com/qq/qq23-bonjour.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM