网络示例

Qt Network 提供了大量网络类,可支持基于客户端和服务器端的网络编程。

这些示例演示了使用 Qt Network 进行网络编程的基本方面。

Blocking Fortune Client

演示如何为网络服务创建客户端。

Broadcast Receiver

演示如何接收通过本地网络广播的信息。

Broadcast Sender

演示如何向本地网络上的多个客户端广播信息。

DNS lookup

演示如何使用 QDnsLookup 查找主机名。

DTLS client

本例演示如何实现客户端 DTLS 连接。

DTLS server

本例演示如何实现简单的 DTLS 服务器。

Fortune Client

演示如何为网络服务创建客户端。

Fortune Server

演示如何为网络服务创建服务器。

HTTP Client

演示简单的 HTTP 客户端。

Multi-stream Client

演示如何在客户端使用 SCTP。

Multi-stream Server

演示如何在服务器端使用 SCTP。

Multicast Receiver

演示如何接收发送到组播组的信息。

Multicast Sender

演示如何向多播组发送信息。

Network Chat

演示有状态点对点聊天客户端。

Secure Socket Client

演示如何通过加密(SSL)连接进行通信。

Threaded Fortune Server

线程财富服务器示例展示了如何为简单的网络服务创建服务器,使用线程处理来自不同客户端的请求。该示例将与 Fortune Client 示例同时运行。

Torrent Example

演示复杂的 TCP/IP 操作。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.