From 561e268bd5a3c5b9f578935766506eee2e81d382 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Fri, 21 Mar 2014 14:49:00 +0100 Subject: 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 --- src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp') diff --git a/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp b/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp index 9c7f2d6..07176da 100644 --- a/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp +++ b/src/imports/qmlwebsockets/qmlwebsockets_plugin.cpp @@ -43,6 +43,9 @@ #include +#include "qqmlwebsocket.h" +#include "qqmlwebsocketserver.h" + QT_BEGIN_NAMESPACE void QtWebSocketsDeclarativeModule::registerTypes(const char *uri) @@ -51,6 +54,7 @@ void QtWebSocketsDeclarativeModule::registerTypes(const char *uri) // @uri Qt.WebSockets qmlRegisterType(uri, 1 /*major*/, 0 /*minor*/, "WebSocket"); + qmlRegisterType(uri, 1 /*major*/, 0 /*minor*/, "WebSocketServer"); } QT_END_NAMESPACE -- cgit v1.2.1