libonion
|
Manages the polling on a set of file descriptors. More...
#include <types.h>
Public Member Functions | |
onion_poller * | onion_poller_new (int n) |
Returns a poller object that helps polling on sockets and files. | |
void | onion_poller_free (onion_poller *p) |
int | onion_poller_add (onion_poller *poller, onion_poller_slot *el) |
Adds a file descriptor to poll. | |
int | onion_poller_remove (onion_poller *poller, int fd) |
Removes a file descriptor, and all related callbacks from the listening queue. | |
void | onion_poller_poll (onion_poller *p) |
Do the event polling. | |
void | onion_poller_stop (onion_poller *p) |
Marks the poller to stop ASAP. |
Data Fields | |
int | fd |
int | eventfd |
fd to signal internal changes on poller. | |
int | timerfd |
fd to set up timeouts | |
time_t | current_timeout_limit |
Currently set limit in seconds. | |
int | n |
char | stop |
onion_poller_slot * | head |
struct ev_loop * | loop |
sem_t | sem |
volatile int | stop |
struct event_base * | base |
Manages the polling on a set of file descriptors.
void onion_poller_free | ( | onion_poller * | p | ) |
References eventfd, fd, head, n, ONION_DEBUG, ONION_DEBUG0, onion_low_free(), ONION_WARNING, pthread_mutex_trylock, pthread_mutex_unlock, stop, and timerfd.
Referenced by onion_free().
struct event_base* onion_poller_t::base |
Referenced by onion_poller_add(), onion_poller_free(), onion_poller_new(), onion_poller_poll(), and onion_poller_stop().
time_t onion_poller_t::current_timeout_limit |
Currently set limit in seconds.
int onion_poller_t::eventfd |
fd to signal internal changes on poller.
Referenced by onion_poller_free(), onion_poller_new(), and onion_poller_stop().
int onion_poller_t::fd |
Referenced by onion_poller_add(), onion_poller_free(), onion_poller_new(), onion_poller_poll(), and onion_poller_remove().
onion_poller_slot* onion_poller_t::head |
Referenced by onion_poller_add(), onion_poller_free(), onion_poller_get(), onion_poller_new(), onion_poller_poll(), and onion_poller_remove().
struct ev_loop* onion_poller_t::loop |
Referenced by onion_poller_add(), onion_poller_new(), onion_poller_poll(), and onion_poller_stop().
int onion_poller_t::n |
Referenced by onion_poller_add(), onion_poller_free(), onion_poller_new(), onion_poller_poll(), and onion_poller_remove().
sem_t onion_poller_t::sem |
Referenced by onion_poller_new(), and onion_poller_poll().
volatile int onion_poller_t::stop |
volatile int onion_poller_t::stop |
Referenced by onion_poller_free(), onion_poller_new(), onion_poller_poll(), onion_poller_poll(), onion_poller_stop(), and onion_poller_stop().
int onion_poller_t::timerfd |
fd to set up timeouts
Referenced by onion_poller_free(), and onion_poller_new().