심플스위치 다이렉트 서버 및 클라이언트

미니멀한 원격 객체 서버 및 클라이언트.

직접 연결 서버 및 직접 연결 클라이언트 애플리케이션은 더 복잡한 애플리케이션의 시작점으로 사용할 수 있는 간단한 예제입니다.

directconnectserver 애플리케이션은 SimpleSwitch 객체로 정의된 렙 파일을 공유하고, directconnectclient 애플리케이션은 해당 객체의 복제본을 가져옵니다. 서버에는 2초 타이머가 있으며, 시간이 초과될 때마다 SimpleSwitch 객체의 부울 currState 속성의 부울 상태가 토글되고 현재 상태가 터미널에 출력됩니다. 각 클라이언트는 SimpleSwitch 복제본의 상태 변경에 연결하고 현재 상태를 서버로 다시 전송합니다. 연결된 모든 클라이언트에 대해 서버는 클라이언트의 상태를 터미널에 다시 출력합니다.

이 두 애플리케이션의 구현은 예제 1에 문서화되어 있습니다.

다른 간단한 예제는 tests/manual/examples/simpleswitch에 있습니다. 이 세 가지 애플리케이션은 예제 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.