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

QT获取网络时间

于 2022-03-21 发布 文件大小:1.23 kB
0 179
下载积分: 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 个回复

  • 在UNIX下开发通用的RTP库srtp,附带文档..
    SRTP在UNIX下开发的通用RTP库,附在文档中详细说明
    2022-06-14 11:25:23下载
    积分:1
  • 新世纪影院源码,可自动生成html文件
    新世纪影院源码,可自动生成html文件-new century theater source that can automatically generate html document
    2022-03-18 21:04:22下载
    积分:1
  • 超级聊天室,这是用asp 写的超级的聊天室
    超级聊天室,这是用asp 写的超级的聊天室-Super Chat Room, which is used to write the Super asp chat rooms
    2022-07-21 06:14:52下载
    积分:1
  • 插件介绍:   XUploadFiles 是一个用于辅助站进行文件上传的客户端插件,同时能够自动生成图片的缩略图。   XUploadFi...
    插件介绍:   XUploadFiles 是一个用于辅助网站进行文件上传的客户端插件,同时能够自动生成图片的缩略图。   XUploadFiles 提供了方便的文件管理模式,以及上传大文件的功能。支持单文件上传、多文件上传、限制文件上传的大小、限制文件上传的类型,同时支持上传进度条的显示和图片缩略图的自动生成。   XUploadFiles 客户端插件属于一个安全插件,对用户是安全的(不会自动选择、自动上传用户的文件),对网站也是安全的(可以限制上传文件的类型、大小),插件安装程序仅30KB左右。   如果您有什么问题或有好的建议,请给我们留言:进入留言板 功能介绍: 支持上传时的断线续传功能 支持多文件选择功能 提供上传文件大小限制、文件个数限制、文件总数据量限制 提供上传文件过滤功能:指定允许上传的文件类型,也可以指定不允许上传的文件类型 显示上传进度条 自动生成缩略图(在浏览器中生成,不占用服务器资源) 支持对上传文件进行统计 提供自定义上传文件名、自定义文件存储路径的功能 提供自定义验证信息的功能 支持Session、Cookie等操作 ………… -plug presentations : XUploadFiles is an auxiliary site for file upload client plug-ins, while that can automatically generate thumbnail pictures. XUploadFiles provide a convenient file management mode, and upload large files. Support single-file uploads, and more file upload, file upload limit to the size, file upload limit the types, while supporting the progress of the upload and show thumbnail pictures generated automatically. XUploa
    2023-09-05 01:00:04下载
    积分:1
  • 基于jsp+javabean+mysql三层结构的动态购物站。站用户口(即界面)由jsp完成,数据和逻辑处理由beans完成,数据储存由mysql完成。因...
    基于jsp+javabean+mysql三层结构的动态购物网站。网站用户接口(即界面)由jsp完成,数据和逻辑处理由beans完成,数据储存由mysql完成。因为beans独立负责处理整个网站的绝大部分数据,所以整个网站的负载量和速度都将大大提高。而且jsp的特性是一次运行,永远储留内存(包括bean在内),所以基于这种语言和结构开发的购物系统的优势是其它语言没法比尔的。更重要的是,jsp+bean能够在Apache环境下顺畅地运行,这也是其最大的优点。这就更进一步保证了网站的稳定性和安全性.-jsp javabean mysql-based three-tier structure of the dynamic shopping site. Terms of the user interface (interface) from jsp completed and the data processed by the logic and beans completed, data storage by mysql completed. Because beans are independently responsible for the handling of the entire site of the majority of data, the entire site load and speed will be greatly enhanced. But jsp characteristic is a running, always reserving memory (including the bean) are therefore based on the language and structure of the shopping development system with the advantage of other languages can not birr. More importantly, jsp bean to the Apache environment to run smoothly, which is its greatest advantage. This site is a further guarantee of stabi
    2023-09-02 04:25:03下载
    积分:1
  • OICQ源序、及设计文档
    OICQ源程序、及设计文档-OICQ source, and design documents
    2022-08-20 05:58:23下载
    积分:1
  • 用在局域中完成机子之间的数据传递,文件传输,这是一个非常标准的例子,给初学者参考最好不过啦!...
    用在局域网中完成机子之间的数据传递,文件传输,这是一个非常标准的例子,给初学者参考最好不过啦!-LAN used in the completion of data transfer between the machine, file transfer, this is a very standard example, to the best beginners reference啦!
    2023-01-06 09:40:03下载
    积分:1
  • 功能介绍: 1、全站生成html(可选) 可减轻服务器负载,提高访问速度,更容易被搜索引擎收录,是大中型站点的必然选择。 2、多管理员...
    功能介绍: 1、全站生成html(可选) 可减轻服务器负载,提高访问速度,更容易被搜索引擎收录,是大中型站点的必然选择。 2、多管理员 -functional presentations : one, the station generated html (optional) to reduce server load, increase the speed, more likely to be included search engine, the large and medium-sized site is a natural choice. Two more administrators
    2023-04-23 03:50:04下载
    积分:1
  • ASP站模块,可以以此为模块制作个人
    ASP网站模块,可以以此为模块制作个人网站-ASP website module, module can be used to produce personal websites
    2022-12-16 12:20:03下载
    积分:1
  • 集中式服务器的聊天应用
    应用背景多用户聊天应用程序使用Python命令行文件:client.py server.py可以帮助多个用户同时进行交互的应用程序。运行client.py:Python client.py服务器IP地址端口号关键技术关键技术:Python•套接字编程TCP
    2022-02-12 07:33:30下载
    积分:1
  • 696518资源总数
  • 106155会员总数
  • 8今日下载