Qt provides classes for both high-level and low-level network communication, classes for web integration, and classes for inter-process communication (IPC).
对于高级网络流量, Qt Network 提供仅展示高级类和函数,覆盖所用操作的抽象层。Qt Network 也可以处理像 TCP 和 UDP 的低级协议。类 QTcpSocket and QUdpSocket enable the developer to send and receive messages using the TCP or UDP protocol. Name resolution is done with QHostInfo . QHostInfo 被调用,先于创建网络连接采用 QTcpSocket or QUdpSocket . Filtering and redistributing network traffic via proxies can be handled by the QNetworkProxy 类。
Qt 提供 connectivity options to connect systems or applications using modules like Qt Bluetooth , which provides connectivity between Bluetooth enabled devices. Qt Serial Bus provides classes and functions to access the various industrial serial buses and protocols, and Qt NFC provides connectivity between NFC enabled devices. Also, Qt Serial Port provides the basic functionality, including configuring, I/O operations, and getting and setting the control signals of the RS-232 pinouts.
Qt offers functionalities for Inter-Process Communication. The class QProcess 被用于启动外部程序。 Qt D-Bus provides support for D-Bus, an inter-process communication and remote procedure calling mechanism. It communicates via a central server application called a bus. However, it is also possible to let applications communicate directly with each other. QSharedMemory provides access to a shared memory segment by multiple threads and processes. However, a single process can exclusively lock that shared memory.
Qt 支持广泛网络通信,重点是 HTTP、TCP 及 UDP。
在 HTTP 级别, Qt Network 模块提供网络访问 API,主要包括 QNetworkRequest , QNetworkAccessManager ,和 QNetworkReply 。 QNetworkRequest 类似于 HTTP 请求,其被传递给 QNetworkAccessManager 以发送线上请求;此类返回 QNetworkReply , which enables parsing the HTTP reply. The network access API internally uses the socket classes mentioned below (for TCP and SSL).
QTcpSocket , QUdpSocket ,和 QSslSocket should be used for communication at the socket level. These classes offer a synchronous API through the waitFor* methods as well as an asynchronous API; if possible (that is if the event loop is running), the asynchronous API should always be preferred. Qt also offers QTcpServer to enable the server-side part of a TCP communication.
为凭借 SSL 进行安全通信,Qt Network 提供广泛的类,除了中心 QSslSocket 。例如, QSslCertificate , QSslConfiguration ,和 QSslError .
Qt also offers HTTP support in QML by either using HTTP explicitly via XmlHttpRequest, or by transparently using HTTP URLs in Image sources for example.
相关话题:
.proto
文件。
Qt 支持一系列连接选项,重点是 Qt Serial Bus , Qt Serial Port , Qt Bluetooth and Qt NFC .
相关话题: