实现自定义传输后端的 API
Qt Remote Objects 为实现自定义传输后端提供了几个抽象接口。这些类背后的概念是,需要有一个主机节点,它有一个可以连接的地址。然后是一个客户端对象,它可以公开构造,并能连接到服务器。当服务器收到连接请求时,它会创建连接的服务器端,直接与客户端通信。因此有三个抽象,一个是服务器( ),一个是连接的客户端( ),第三个是连接的服务器端( )。后两个抽象继承自 。QConnectionAbstractServer
QtROClientIoDevice
QtROServerIoDevice
QtROIoDeviceBase
应用程序接口概述
QtROIoDeviceBase
QtROClientIoDevice
QtROServerIoDevice
QConnectionAbstractServer
实现这些接口后,您可以使用qRegisterRemoteObjectsServer() 和qRegisterRemoteObjectsClient() 方法注册您的自定义协议。
注: 提供这些 API 的目的是为Qt Remote Objects 实现自定义通信协议提供更大的灵活性。它们没有源代码或二进制兼容性保证,这意味着 API 只能保证与开发时所使用的 Qt 版本兼容。不过,只有在次要版本中才会对 API 进行修改。(6.1、6.2 等)。
© 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.