QML WebSocket server

Author: Yiqu, Ersanli
Personal Wechat ID: iwaleon
Wechat Official Account: Efficient Programmer

In the " QML WebSocket Client " section, we developed a WebSocket client, but when testing, it is connected to the Echo Server provided by Postman. Now, it's time to write a service that really belongs to you, and this needs to be realized through the WebSocketServer type provided by QML.

We said before that the WebSocket type in QML is implemented based on QWebSocket in C++/Qt, and QWebSocket and QWebSocketServer are paired, so as you think, the WebSocketServer type is implemented based on QWebSocketServer.

That is to say, whether it is WebSocket client-side programming or server-side programming, as long as you are familiar with the relevant usage in C++/Qt, you can easily understand and master the ones in QML.

The complete mind map is as follows:

insert image description here

The basic steps

To implement a WebSocket Server, the following steps are required.

  1. Import the WebSocket module
 

Guess you like

Origin blog.csdn.net/u011012932/article/details/132361628