WebSocketServer QML Type

QML 인터페이스 QWebSocketServer. 더 보기...

Import Statement: import QtWebSockets 1.8

속성

신호

상세 설명

속성 문서

accept : bool

서버가 수신 대기 중일 때 들어오는 클라이언트 연결을 허용하려면 true로 설정합니다. false로 설정하면 들어오는 연결이 거부됩니다. 기본적으로 연결이 허용됩니다.


errorString : string [read-only]

오류가 발생한 경우의 문자열화된 오류 메시지입니다.


host : string

서버의 호스트 주소입니다. 기본적으로 localhost가 사용됩니다.


listen : bool

서버가 클라이언트 연결을 수신 대기해야 하는 경우 참으로 설정하고 그렇지 않으면 거짓으로 설정합니다. true로 설정하면 서버는 호스트 및 포트에 의해 정의된 지정된 URL에서 수신 대기하며, accept가 true인 경우 들어오는 클라이언트 연결을 수락합니다. 그렇지 않으면 서버가 닫힙니다. 기본적으로 서버는 수신 대기하지 않습니다.


name : string

http 핸드셰이크 단계에서 사용되는 이 서버의 이름입니다.


port : int

이 서버가 수신 대기 중인 포트입니다. 값은 0-65535 범위여야 합니다.

기본적으로 포트는 자동으로 선택됩니다.


supportedSubprotocols : list<string> [since 6.4]

서버가 지원하는 프로토콜 목록입니다.

이 속성은 Qt 6.4에 도입되었습니다.


url : url [read-only]

클라이언트 웹소켓이 연결할 수 있는 서버 URL. URL은 ws:// 스키마를 사용하며 서버가 수신하는 포트와 서버의 호스트 주소를 포함합니다.


신호 문서

clientConnected(WebSocket webSocket)

이 신호는 클라이언트가 이 서버에 연결할 때 전송됩니다. webSocket 는 새로 생성된 WebSocket 입니다.

참고: 해당 핸들러는 onClientConnected 입니다.


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