-
Notifications
You must be signed in to change notification settings - Fork 0
/
wechat.h
54 lines (45 loc) · 915 Bytes
/
wechat.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef WECHAT_H
#define WECHAT_H
#include <QObject>
#include "unistd.h"
#include "arpa/inet.h"
#include "sys/socket.h"
#include <QDebug>
//#include "wechat.h"
struct wechat_user{
char name[20];
char passwd[20];
int sex;
int fd;
int is_online;
};
#define SUB_MAXEVENTS 100
#define MAX_USERS 100
#define MAX_BYTE 512
#define WECHAT_SIGNUP 0x01
#define WECHAT_SIGNIN 0x02
#define WECHAT_SIGOUT 0x04
#define WECHAT_ACK 0x08
#define WECHAT_NAK 0x10
#define WECHAT_WALL 0X20
#define WECHAT_MSG 0x40
#define WECHAT_SYS 0x80
#define WECHAT_FIN 0x04
struct wechat_msg{
int type;
int sex;
char name[20];
char passwd[20];
char msg[MAX_BYTE];
char to[20];
};
class WorkerMsg:public QObject
{
Q_OBJECT
public:
explicit WorkerMsg(QObject *parent = nullptr);
void doWork(int fd,wechat_msg msg);
signals:
void resultReady(wechat_msg msg);
};
#endif // WECHAT_H