登录
首页 » 套接字网络编程 » QT获取网络时间

QT获取网络时间

于 2022-03-21 发布 文件大小:1.23 kB
0 233
下载积分: 2 下载次数: 1

代码说明:

基本过程如下: 1. 利用ntp服务器获取网络时间     QUdpSocket udp_sock;     udp_sock.connectToHost("time.windows.com",123); 2. 阻塞等待连接成功     if(udp_sock.waitForConnected(60000))     {         ...     } 3. 发送时间请求         udp_sock.write(time_req);         udp_sock.flush(); 4. 阻塞等待消息返回         if(udp_sock.waitForReadyRead(120000))         {             ...         } 说明:此过程等待时间可能较长,出现连接失败的情况也比较常见。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 以太交换机私有协议,能实现快速环功能,类似于RAPP协议
    以太网交换机私有协议,能实现快速环网功能,类似于RAPP协议-the network provite protocol for Ring,the same the RAPP protocol....
    2022-10-03 06:30:03下载
    积分:1
  • 端口扫描外国站上下的
    端口扫描外国网站上下的-port scanning overseas websites across the
    2022-10-17 19:20:03下载
    积分:1
  • This is a similar network ants procedures, using visual c 6.0, more efficient.
    这是一个类似网络蚂蚁的程序,采用visual c++6.0,效率比较高。-This is a similar network ants procedures, using visual c 6.0, more efficient.
    2022-04-30 23:27:34下载
    积分:1
  • WiMAX, or the IEEE 802.16 standard for broadband wireless access, is increasingl...
    WiMAX, or the IEEE 802.16 standard for broadband wireless access, is increasingly gaining in popularity as a technology with significant market potential. This paper first provides an overview of the existing and developing 802.16 standards and their key differences/applications. The PHY and MAC layers of a typical WiMAX base station are then described. The associated implementation challenges faced by WiMAX infrastructure developers, including performance/cost/flexibility trade-offs in the choice of silicon, are clearly outlined. The paper then describes how FPGA-based system implementation can address these challenges including the “accelerated time-to-market” requirement which is considered a key enabler for early success in this market. As an example design, the physical layer implementation of the 802.16d standard with Altera FPGAs and intellectual property (IP) is proposed.
    2023-04-25 10:35:04下载
    积分:1
  • 当路由器出现问题,你可以不必要去关掉路由器的电源了,现在可以远重新启动路由器,...
    当路由器出现问题,你可以不必要去关掉路由器的电源了,现在可以远程重新启动路由器,-When the router problem, you can go to switch off unnecessary power router, and now can remotely restart the router,
    2022-06-15 21:25:18下载
    积分:1
  • 开机和mac发现
    应用背景寻找局域网内的主机,并且可以开启和关闭指定的主机。这个程序主要是来实现局域网内的远程开关机功能,方便对局域网内的电脑进行控制,欢迎有需要的同学下载使用,这个程序是好不容易写出来的,希望能够帮助你们。关键技术主要是应用技术是socket套接字技术,网络通信。主要是MFC 来做界面,利用网络通信协议来实现通信,socket套接字是网络通信的基础,在此基础上开发出了三个功能,对局域网内主机开机,对局域网内主机关机和mac地址寻找。
    2022-05-09 03:00:23下载
    积分:1
  • 聊天工具
    这是一个在Linux下用gtk 和socket编写的基于TCP/IP的网络通讯工具,有一个服务器端,一个客户端,在客户端和服务器端进行两两通信。本代码简单易懂适合初学gtk和socket的使用。
    2022-08-06 15:55:05下载
    积分:1
  • 在linux下的聊天软件,不同于freechat.beta2e.rar。功能不同
    在linux下的聊天软件,不同于freechat.beta2e.rar。功能不同-in the chat software, unlike freechat.beta2e.rar. Different functions
    2022-12-14 04:15:04下载
    积分:1
  • vc used to achieve the domain search tool
    用vc实现的域名查找工具-vc used to achieve the domain search tool
    2022-05-13 07:48:43下载
    积分:1
  • 邮件原代码用socket
    邮件原代码用socket编-mail with the original code socket series
    2022-12-23 20:25:03下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载