WebSocketServer QML Type
QML interface to QWebSocketServer. More...
Import Statement: | import QtWebSockets 1.5 |
Properties
- accept : bool
- errorString : QString
- host : QString
- listen : bool
- name : QString
- port : int
- supportedSubprotocols : QStringList
- url : QUrl
Signals
- clientConnected(WebSocket webSocket)
Detailed Description
Property Documentation
accept : bool |
Set to true to accept incoming client connections when the server is listening. When set to false, incoming connections are rejected. By default, connections are accepted.
[read-only] errorString : QString |
The stringified error message in case an error occurred.
host : QString |
The host address of the server. By default, localhost is used.
listen : bool |
Set to true when the server should listen to client connections or false otherwise. When set to true, the server will listen on the specified url defined by host and port and, when accept is true, accepts incoming client connections. Otherwise the server is closed. By default, the server is not listening.
name : QString |
The name of this server used during the http handshake phase.
port : int |
The port this server is listening on. The value must be in the range 0-65535.
By default, a port is chosen automatically.
[since 6.4] supportedSubprotocols : QStringList |
The list of protocols supported by the server.
This property was introduced in Qt 6.4.
[read-only] url : QUrl |
Server url that client WebSockets can connect to. The url uses the ws:// scheme and includes the port the server listens to and the host address of the server.
Signal Documentation
clientConnected(WebSocket webSocket) |
This signal is emitted when a client connects to this server. webSocket is the newly created WebSocket.
Note: The corresponding handler is onClientConnected
.
© 2023 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.