diff options
author | Milian Wolff <mail@milianw.de> | 2014-03-21 14:49:00 +0100 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2014-07-02 14:41:09 +0200 |
commit | 561e268bd5a3c5b9f578935766506eee2e81d382 (patch) | |
tree | b6e95452c27c69d21fff8605823255aeed72b81d /src/imports/qmlwebsockets/qqmlwebsocket.h | |
parent | 3f99082f3bb81982e0c6777875fb5c2a1d9033df (diff) | |
download | qtwebsockets-561e268bd5a3c5b9f578935766506eee2e81d382.tar.gz |
Add initial support for a declarative WebSocketServer.
It comes with basic support for setting up a non-secure server
listening on an arbitrary host and port. The name can be set,
and whether the server should be listening or accept connections.
The error string is also available via a property.
When a client connects, a clientConnected(QQmlWebSocket*) signal is
emitted.
To showcase the usage and functionality, a new qmlwebsocketserver
example is added which behaves similar to qmlwebsocketclient. It
simply sends messages from a WebSocket to a local WebSocketServer
which in turn sends a simple response.
Change-Id: Ib6318155ed08cbeea47d820b709764d2e36dcc45
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/imports/qmlwebsockets/qqmlwebsocket.h')
-rw-r--r-- | src/imports/qmlwebsockets/qqmlwebsocket.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/qmlwebsockets/qqmlwebsocket.h b/src/imports/qmlwebsockets/qqmlwebsocket.h index 2e02f33..205f24d 100644 --- a/src/imports/qmlwebsockets/qqmlwebsocket.h +++ b/src/imports/qmlwebsockets/qqmlwebsocket.h @@ -64,6 +64,7 @@ class QQmlWebSocket : public QObject, public QQmlParserStatus public: explicit QQmlWebSocket(QObject *parent = Q_NULLPTR); + explicit QQmlWebSocket(QWebSocket *socket, QObject *parent = Q_NULLPTR); virtual ~QQmlWebSocket(); enum Status @@ -109,6 +110,8 @@ private: bool m_componentCompleted; QString m_errorString; + // takes ownership of the socket + void setSocket(QWebSocket *socket); void setStatus(Status status); void open(); void close(); |