Simpleswitch Direct 서버 및 클라이언트

최소한의 기능만 갖춘 원격 객체 서버 및 클라이언트입니다.

소스 상태와 복제본 상태가 true와 false로 번갈아 바뀌는 터미널 출력

directconnectserver 및 directconnectclient 애플리케이션은 보다 복잡한 애플리케이션을 개발할 때 출발점으로 활용할 수 있는 간단한 예제입니다.

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

이 두 애플리케이션의 구현 내용은 예제 1에 설명되어 있습니다.

다른 간단한 예제들은 tests/manual/examples/simpleswitch에 있습니다. 이 세 가지 애플리케이션에 대한 설명은 예제 2와 예제 3에서 확인할 수 있습니다.

예제 프로젝트 @ code.qt.io

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