Simpleswitch Direct サーバーとクライアント

最小限のリモートオブジェクトサーバーとクライアントです。

directconnectserver と directconnectclient アプリケーションはより複雑なアプリケーションの開始点として使用できる簡単な例です。

directconnectserverアプリケーションはrepファイルで定義されたSimpleSwitchオブジェクトを共有し、directconnectclientアプリケーションはそのレプリカを取得します。サーバには2秒間のタイマーがあり、タイムアウトする度にSimpleSwitchオブジェクトのcurrStateプロパティのboolean状態がトグルされ、現在の状態がターミナルに出力されます。各クライアントはSimpleSwitchレプリカの状態変化に接続し、現在の状態をサーバに返します。接続された全てのクライアントに対して、サーバはクライアントの状態を端末にプリントアウトします。

これら二つのアプリケーションの実装は1に書かれています。

他の簡単な例は tests/manual/examples/simpleswitch にあります。これら3つのアプリケーションは2と3で説明します。

例プロジェクト @ code.qt.io

© 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.