C++ QT中 通过UDP广播获取网络中所有设备ip地址

上传者: dxzysk | 上传时间: 2019-12-21 19:41:16 | 文件大小: 856KB | 文件类型: rar
代码说明参考博客:http://blog.csdn.net/dxzysk/article/details/55511269 本文是C++的QT版本,有时候需要搜索网络中的设备,机器,服务器等,这就要要用到UDP广播的方式,发送广播命令,广播给网络中的每一个主机,该主机搜到广播命令后,立刻发送给请求端自己的设备信息,这里以IP信息为例子。

文件下载

资源详情

[{"title":"( 31 个子文件 856KB ) C++ QT中 通过UDP广播获取网络中所有设备ip地址","children":[{"title":"QTDemoUDPBroadcast-csdn","children":[{"title":"UDPTestServer","children":[{"title":"mainwindow.ui <span style='color:#111;'> 989B </span>","children":null,"spread":false},{"title":"UDPTestServer.pro.user <span style='color:#111;'> 17.91KB </span>","children":null,"spread":false},{"title":"mainwindow.cpp <span style='color:#111;'> 3.15KB </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 208B </span>","children":null,"spread":false},{"title":"mainwindow.h <span style='color:#111;'> 743B </span>","children":null,"spread":false},{"title":"UDPTestServer.pro <span style='color:#111;'> 403B </span>","children":null,"spread":false}],"spread":true},{"title":"build-UDPTestServer-Desktop_Qt_5_3_MinGW_32bit-Debug","children":[{"title":"release","children":null,"spread":false},{"title":"debug","children":[{"title":"moc_mainwindow.cpp <span style='color:#111;'> 3.30KB </span>","children":null,"spread":false},{"title":"main.o <span style='color:#111;'> 138.56KB </span>","children":null,"spread":false},{"title":"UDPTestServer.exe <span style='color:#111;'> 856.97KB </span>","children":null,"spread":false},{"title":"mainwindow.o <span style='color:#111;'> 421.57KB </span>","children":null,"spread":false},{"title":"moc_mainwindow.o <span style='color:#111;'> 168.63KB </span>","children":null,"spread":false}],"spread":true},{"title":"Makefile <span style='color:#111;'> 23.39KB </span>","children":null,"spread":false},{"title":"ui_mainwindow.h <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 55.44KB </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 55.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"UDPTestClient","children":[{"title":"mainwindow.ui <span style='color:#111;'> 989B </span>","children":null,"spread":false},{"title":"UDPTestClient..user <span style='color:#111;'> 17.88KB </span>","children":null,"spread":false},{"title":"UDPTestClient..pro.user <span style='color:#111;'> 17.93KB </span>","children":null,"spread":false},{"title":"mainwindow.cpp <span style='color:#111;'> 3.00KB </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 208B </span>","children":null,"spread":false},{"title":"mainwindow.h <span style='color:#111;'> 691B </span>","children":null,"spread":false},{"title":"UDPTestClient..pro <span style='color:#111;'> 403B </span>","children":null,"spread":false}],"spread":true},{"title":"build-UDPTestClient-Desktop_Qt_5_3_MinGW_32bit-Debug","children":[{"title":"release","children":null,"spread":false},{"title":"debug","children":[{"title":"moc_mainwindow.cpp <span style='color:#111;'> 3.31KB </span>","children":null,"spread":false},{"title":"main.o <span style='color:#111;'> 138.57KB </span>","children":null,"spread":false},{"title":"mainwindow.o <span style='color:#111;'> 389.46KB </span>","children":null,"spread":false},{"title":"moc_mainwindow.o <span style='color:#111;'> 168.53KB </span>","children":null,"spread":false},{"title":"UDPTestClient.exe <span style='color:#111;'> 830.18KB </span>","children":null,"spread":false}],"spread":true},{"title":"Makefile <span style='color:#111;'> 23.43KB </span>","children":null,"spread":false},{"title":"ui_mainwindow.h <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"Makefile.Debug <span style='color:#111;'> 55.53KB </span>","children":null,"spread":false},{"title":"Makefile.Release <span style='color:#111;'> 55.60KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • lf8013 :
    不错,亲测一个客户端一个服务器可以实现
    2020-02-10
  • lbsljn :
    可以运行,再次尝试
    2019-07-09
  • LIN13750107574 :
    谢谢楼主,非常有用!
    2018-03-12
  • haoyuyi :
    还不错,挺详细的
    2017-12-27
  • hanet :
    确定是入门的好例子
    2017-12-05

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明