summaryrefslogtreecommitdiff
path: root/examples/echoserver/echoserver.h
diff options
context:
space:
mode:
authorKurt Pattyn <pattyn.kurt@gmail.com>2013-08-12 11:00:58 +0200
committerKurt Pattyn <pattyn.kurt@gmail.com>2013-08-12 11:00:58 +0200
commitea0800163c8c994f50211ce4f76d157f84ac73ef (patch)
tree4e709f8e97ed8d63d5a96aca22103561b4f36a82 /examples/echoserver/echoserver.h
parent2b193c459f0d62a7b81b79182589cf4d39e3b667 (diff)
downloadqtwebsockets-ea0800163c8c994f50211ce4f76d157f84ac73ef.tar.gz
Renamed HelloWorldServer to EchoServer
Diffstat (limited to 'examples/echoserver/echoserver.h')
-rw-r--r--examples/echoserver/echoserver.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/echoserver/echoserver.h b/examples/echoserver/echoserver.h
new file mode 100644
index 0000000..21cf0de
--- /dev/null
+++ b/examples/echoserver/echoserver.h
@@ -0,0 +1,30 @@
+#ifndef ECHOSERVER_H
+#define ECHOSERVER_H
+
+#include <QObject>
+#include <QList>
+#include <QByteArray>
+
+class WebSocketServer;
+class WebSocket;
+
+class EchoServer : public QObject
+{
+ Q_OBJECT
+public:
+ explicit EchoServer(quint16 port, QObject *parent = 0);
+
+Q_SIGNALS:
+
+private Q_SLOTS:
+ void onNewConnection();
+ void processMessage(QString message);
+ void processBinaryMessage(QByteArray message);
+ void socketDisconnected();
+
+private:
+ WebSocketServer *m_pWebSocketServer;
+ QList<WebSocket *> m_clients;
+};
+
+#endif //ECHOSERVER_H