-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClient.h
More file actions
42 lines (32 loc) · 688 Bytes
/
Client.h
File metadata and controls
42 lines (32 loc) · 688 Bytes
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
#ifndef CLIENT_H
#define CLIENT_H
#include <sys/epoll.h>
#include <string>
#include <sstream>
#include <pthread.h>
struct Client {
Client(int newFd) {
fd = newFd;
timeLastRead = 0;
timeAccepted = time(0);
c_headers = 0;
headerLength = 0;
allocated = 0;
isClosed = false;
}
~Client() {
if(c_headers != 0) {
free(c_headers);
c_headers = 0;
}
}
int fd;
epoll_event* event;
time_t timeLastRead;
time_t timeAccepted;
char* c_headers;
int headerLength;
int allocated;
bool isClosed;
};
#endif /* CLIENT_H */