This file is used to define functions related to epoll that would be used mainly in network.c.
More...
Go to the source code of this file.
This file is used to define functions related to epoll that would be used mainly in network.c.
- Warning
- Do not use any functions inside this file outside of network.c, unless you know what you're doing.
◆ SNF_MAXEVENTS
#define SNF_MAXEVENTS 4096 |
Defines the epoll's limit.
- Note
- Temporarly is a fixed value of 4096 for testing purposes
◆ snf_epoll_init()
◆ snf_epoll_add()
int snf_epoll_add |
( |
int | FD | ) |
|
|
extern |
Add's a file descriptor to be handled by epoll.
- Parameters
-
FD | The File descriptor to be added |
- Returns
- The result :
◆ snf_epoll_del()
void snf_epoll_del |
( |
int | fd | ) |
|
|
extern |
removes a file descriptor from being handled by epoll
- Parameters
-
fd | The File descriptor to be removed |
◆ snf_epoll_getList()
int snf_epoll_getList |
( |
| ) |
|
|
extern |
Fetches the awaiting Epoll Events
- Returns
- The result of the wait
- Note
- - This function will block depending on epoll_wait (set with a timeout of 10 ms)
-
- the awaiting Epoll Events will be put in SNF_EPOLL_EVENTS
◆ SNF_EPOLL_EVENTS
Used to save the waiting Epoll Events
◆ SNF_NFDS
Describes the amount of file descriptors to be handled.
◆ SNF_EPOLLFD
Defines Epoll's file descriptor.