Ripples 1.0
High Performant Software Architecture For Transaction Processing
Loading...
Searching...
No Matches
Vectorloop Epoll

Detailed Description

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)
 

Function Documentation

◆ vl_epoll_create()

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.

Returns
On success returns a file descriptor (a nonnegative integer). On error message if printed to stderr and assert called.
Here is the caller graph for this function:

◆ vl_epoll_ctl_del()

void vl_epoll_ctl_del ( int  ep_fd,
int  fd 
)

Remove (delete) a socket from epoll.

Note
If socket could not be removed from epoll a message is printed to stderr and assert called.
Parameters
ep_fdEpoll file descriptor.
fdSocket to remove
Here is the caller graph for this function:

◆ vl_epoll_ctl_reg_for_read_et()

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.

Note
If socket could not be registered with epoll a message is printed to stderr and assert called.
Parameters
ep_fdEpoll file descriptor to register with.
fdSocket to register
idEvent ID associated with socket.
Here is the caller graph for this function:

◆ vl_epoll_ctl_reg_for_readwrite_et()

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.

Note
If socket could not be registered with epoll a message is printed to stderr and assert called.
Parameters
ep_fdEpoll file descriptor to register with.
fdSocket to register
idEvent ID associated with socket.
Here is the caller graph for this function:

◆ vl_epoll_wait()

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).

Parameters
ep_fdVectorloop operating under.
ep_eventsArray of epoll events.
num_max_eventsMaximum number of events to report. There MUST be at least this many entries in ep_events array.
Returns
On success returns number of events returned by epoll. On error, message if printed to stderr and assert called.
Here is the caller graph for this function: