Simpleswitch 直接服务器和客户端
一款极简风格的远程对象服务器和客户端。

directconnectserver 和 directconnectclient 应用程序是简单的示例,可作为开发更复杂应用程序的起点。
directconnectserver 应用程序共享一个由 rep 文件定义的 SimpleSwitch 对象,而 directconnectclient 应用程序则获取该对象的一个副本。 服务器有一个两秒的计时器,每次超时,SimpleSwitch 对象的 boolean currState 属性的布尔状态就会被切换,并且当前状态会被打印到终端上。 每个客户端都连接到 SimpleSwitch 副本的状态变化,并将当前状态发回给服务器。对于每个已连接的客户端,服务器都会将该客户端的状态打印回终端。
这两个应用程序的实现详见示例 1。
其他简单示例位于 tests/manual/examples/simpleswitch 目录下。这三个应用程序的文档详见示例 2 和示例 3。
© 2026 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.