starting work on websocket chat reader
This commit is contained in:
30
chatreader.hpp
Normal file
30
chatreader.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef CHATREADER_HPP
|
||||
#define CHATREADER_HPP
|
||||
|
||||
#include "chatmessage.hpp"
|
||||
|
||||
#include <QWebSocket>
|
||||
|
||||
class ChatReader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static const QUrl URL;
|
||||
|
||||
ChatReader();
|
||||
~ChatReader();
|
||||
bool getConnected() const;
|
||||
void open();
|
||||
qint64 send(QString message);
|
||||
signals:
|
||||
void chatMessageReceived(const ChatMessage* message);
|
||||
protected slots:
|
||||
void socketConnect();
|
||||
void socketDisconnect();
|
||||
void messageReceived(QString message);
|
||||
private:
|
||||
QWebSocket socket;
|
||||
bool _connected = false;
|
||||
};
|
||||
|
||||
#endif // CHATREADER_HPP
|
||||
Reference in New Issue
Block a user