QML WebSocket 服务器

一个显示如何使用 QMLWebSocketServer 的简单示例。

QML WebSocket 服务器图形用户界面

该示例打开一个窗口,有一个WebSocketServer 监听传入连接,还有一个 WebSocket 连接到WebSocketServer 。每次点击窗口,WebSocket 都会向WebSocketServer 发送一条消息。WebSocketServer 有一个信号处理器,将传入消息记录到窗口并再次发送消息,WebSocket 有一个信号处理器,将返回消息记录到窗口。

示例项目 @ 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.