-
Notifications
You must be signed in to change notification settings - Fork 4
/
LocalClient.hpp
39 lines (31 loc) · 941 Bytes
/
LocalClient.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef LOCALCLIENT_HPP
#define LOCALCLIENT_HPP
#include <QObject>
class QTcpSocket;
class LocalClient : public QObject
{
Q_OBJECT
public:
explicit LocalClient(QObject *parent = 0);
signals:
void connected();
void messageReceived(QString client, QString message);
void participantsReceived(const QList<int> &ids, const QStringList &names);
void tunneledMessageReceived(int idFrom, const QByteArray &message);
public slots:
void connectToServer(QString address, quint16 port);
void sendMessage(QString message);
void setNickname(QString nickname);
void getParticipants();
void sendTunneledMessage(int idTo, const QByteArray &message);
protected slots:
void onReadyRead();
void onConnected();
void sendPackage(const QByteArray &package);
protected:
QTcpSocket *m_socket;
QString m_pendingNickname;
QString m_nickname;
quint32 m_size;
};
#endif // LOCALCLIENT_HPP