forked from parihaaraka/cpp2tnt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtntevloop.h
More file actions
38 lines (27 loc) · 932 Bytes
/
tntevloop.h
File metadata and controls
38 lines (27 loc) · 932 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
#pragma once
#include <ev.h>
#include "connector.h"
namespace tnt
{
class TntEvLoop : public Connector
{
public:
TntEvLoop();
~TntEvLoop();
void Attach(struct ev_loop* loop);
protected:
struct ev_loop* loop_;
bool isStoped_ = false;
ev_io socketWatcher_;
static void OnSocketEvent_(struct ev_loop* loop, ev_io* w, int revents);
void OnSocketEvent(struct ev_loop* loop, ev_io* w, int revents);
ev_async asyncNotifier_;
static void OnAsyncNotifier_(struct ev_loop* loop, ev_async* w, int revents);
void OnAsyncNotifier(struct ev_loop* loop, ev_async* w, int revents);
ev_timer timer_;
static void OnTimer_(struct ev_loop* loop, ev_timer* w, int revents);
void OnTimer(struct ev_loop* loop, ev_timer* w, int revents);
void OnSocketWatcherRequest(int mode) noexcept;
void OnConnected() noexcept;
};
}