-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhandler.h
More file actions
45 lines (37 loc) · 749 Bytes
/
Copy pathhandler.h
File metadata and controls
45 lines (37 loc) · 749 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
43
44
45
#pragma once
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/tcp.h>
#include <netinet/in.h>
#include <pthread.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include "spdlog/spdlog.h"
#include <string>
#include "buffer.h"
#include "dispatcher.h"
#include "event2/event.h"
#include "event2/util.h"
namespace tl {
class Handler {
public:
Handler(Dispatcher* disp, int fd);
~Handler();
int handleRead();
int handleWrite();
int fd() { return fd_; }
private:
int fd_ = -1;
event* ev_ = nullptr;
Dispatcher* disp_;
buffer read_buf_;
buffer write_buf_;
};
} // namespace tl