diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-04-30 10:06:28 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-05-26 18:41:21 +0200 |
commit | 0243cbe0170a768f8f8998c6f7f234869c8c77e6 (patch) | |
tree | 9a55ed100042a82dad8489286e06c1341b06448a /src/qookie-cast-client.h | |
parent | 5e351b7783e5ad135b6918b5f5d92d78723a4a04 (diff) |
Add 4-byte size arg to socket payload. Add qookie-cast client (server really) with receiving socket.
Diffstat (limited to 'src/qookie-cast-client.h')
-rw-r--r-- | src/qookie-cast-client.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/qookie-cast-client.h b/src/qookie-cast-client.h new file mode 100644 index 0000000..766b48b --- /dev/null +++ b/src/qookie-cast-client.h @@ -0,0 +1,34 @@ +// -*- c++ -*- +#include <QtCore> +#include <QtNetwork> + +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) +// Qt4 support +#include <QWebView> +using WebView = QWebView; +#else +#include <QTextEdit> +using WebView = QTextEdit; +#endif + +class Server + : public QObject +{ + Q_OBJECT +public: + Server(WebView& webview, QObject *parent = 0); + +signals: + void dataReceived(QByteArray); + +private slots: + void newConnection(); + void disconnected(); + void readyRead(); + +private: + QTcpServer *server; + WebView& webview; + QString html; + int size{-1}; +}; |