-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathequeue.h
More file actions
36 lines (23 loc) · 667 Bytes
/
equeue.h
File metadata and controls
36 lines (23 loc) · 667 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
#ifndef SC6_EQUEUE_H
#define SC6_EQUEUE_H
#define EQUEUE_EVENTS_EACH_LOOP 32
#ifdef __APPLE__
#include <sys/event.h>
#else
#include <sys/epoll.h>
#endif
struct Eevent {
#ifdef __APPLE__
struct kevent evList[EQUEUE_EVENTS_EACH_LOOP];
#else
struct epoll_event evList[EQUEUE_EVENTS_EACH_LOOP];
#endif
};
int initEqueue();
void addClientEqueue(int equeue, int clientSocket);
void deleteClientEqueue(int equeue, int clientSocket);
int checkEqueue(int equeue, struct Eevent *eevent);
int getSocketEqueue(struct Eevent *eevent, int index);
int isEof(struct Eevent *eevent, int index);
int isRead(struct Eevent *eevent, int index);
#endif //SC6_EQUEUE_H