pureqml / controls

Miscellaneous platform-independent components library for PureQML
MIT License
24 stars 15 forks source link

Rewrite the WebSocketClient to be a thin wrapper around WebSockets #21

Closed BerndAmend closed 3 years ago

BerndAmend commented 3 years ago

It is mostly based on the WebSocket API. It differs greatly from the Qt API (https://doc.qt.io/qt-5/qml-qtwebsockets-websocket.html). I'm still unsure if we should directly provide connect/close or instead use a property to connect/close as the Qt API (called active). Changing the API shouldn't be an issue since the old implementation was broken (this._socket was undefined). The old API was inconsistent, send didn't call JSON.stringify() but onMessage called JSON.parse(), therefore I dropped it.