|
Ripples 1.0
High Performant Software Architecture For Transaction Processing
|
These are function that wrapp epoll to provide functionality suited for application purpose. Only Edge Triggered epoll events are used.
Functions | |
| int | vl_epoll_create (void) |
| uint32_t | vl_epoll_wait (int ep_fd, struct epoll_event *ep_events, int num_max_events) |
| void | vl_epoll_ctl_reg_for_read_et (int ep_fd, int fd, uint64_t id) |
| void | vl_epoll_ctl_reg_for_readwrite_et (int ep_fd, int fd, uint64_t id) |
| void | vl_epoll_ctl_del (int ep_fd, int fd) |
| int vl_epoll_create | ( | void | ) |
Create an epoll file descriptor.
From linux man page on epoll_create():
ERRORS EINVAL size is not positive.
EINVAL (epoll_create1()) Invalid value specified in flags.
EMFILE The per-user limit on the number of epoll instances imposed by /proc/sys/fs/epoll/max_user_instances was encountered. See epoll(7) for further de‐ tails.
EMFILE The per-process limit on the number of open file descriptors has been reached.
ENFILE The system-wide limit on the total number of open files has been reached.
ENOMEM There was insufficient memory to create the kernel object.

| void vl_epoll_ctl_del | ( | int | ep_fd, |
| int | fd | ||
| ) |
Remove (delete) a socket from epoll.
| ep_fd | Epoll file descriptor. |
| fd | Socket to remove |

| void vl_epoll_ctl_reg_for_read_et | ( | int | ep_fd, |
| int | fd, | ||
| uint64_t | id | ||
| ) |
Register an open socket with epoll for Edge Triggered read events.
| ep_fd | Epoll file descriptor to register with. |
| fd | Socket to register |
| id | Event ID associated with socket. |

| void vl_epoll_ctl_reg_for_readwrite_et | ( | int | ep_fd, |
| int | fd, | ||
| uint64_t | id | ||
| ) |
Register an open socket with epoll for Edge Triggered read and write events.
| ep_fd | Epoll file descriptor to register with. |
| fd | Socket to register |
| id | Event ID associated with socket. |

| uint32_t vl_epoll_wait | ( | int | ep_fd, |
| struct epoll_event * | ep_events, | ||
| int | num_max_events | ||
| ) |
Issue epoll wait on vectorloop epoll instance and return number of events epoll_wait() returned. epoll_wait is called with timeout of 0.
If there was an error in which case epoll_wait() returned -1, function aborts (throws an exception).
| ep_fd | Vectorloop operating under. |
| ep_events | Array of epoll events. |
| num_max_events | Maximum number of events to report. There MUST be at least this many entries in ep_events array. |
