typedef struct apr_pollfd_t apr_pollfd_t |
typedef struct apr_pollset_t apr_pollset_t |
Opaque structure used for pollset API
enum apr_datatype_e |
Used in apr_pollfd_t to determine what the apr_descriptor is
apr_status_t apr_poll | ( | apr_pollfd_t * | aprset, | |
apr_int32_t | numsock, | |||
apr_int32_t * | nsds, | |||
apr_interval_time_t | timeout | |||
) |
Poll the sockets in the poll structure
aprset | The poll structure we will be using. | |
numsock | The number of sockets we are polling | |
nsds | The number of sockets signalled. | |
timeout | The amount of time in microseconds to wait. This is a maximum, not a minimum. If a socket is signalled, we will wake up before this time. A negative number means wait until a socket is signalled. |
The number of sockets signalled is returned in the second argument.
apr_status_t apr_poll_revents_get | ( | apr_int16_t * | event, | |
apr_socket_t * | sock, | |||
apr_pollfd_t * | aprset | |||
) |
Get the return events for the specified socket.
event | The returned events for the socket. One of: APR_POLLIN Data is available to be read APR_POLLPRI Priority data is availble to be read APR_POLLOUT Write will succeed APR_POLLERR An error occurred on the socket APR_POLLHUP The connection has been terminated APR_POLLNVAL This is an invalid socket to poll on. Socket not open. | |
sock | The socket we wish to get information about. | |
aprset | The poll structure we will be using. |
apr_status_t apr_poll_setup | ( | apr_pollfd_t ** | new_poll, | |
apr_int32_t | num, | |||
apr_pool_t * | cont | |||
) |
Setup the memory required for poll to operate properly
new_poll | The poll structure to be used. | |
num | The number of socket descriptors to be polled. | |
cont | The pool to operate on. |
apr_status_t apr_poll_socket_add | ( | apr_pollfd_t * | aprset, | |
apr_socket_t * | sock, | |||
apr_int16_t | event | |||
) |
Add a socket to the poll structure.
aprset | The poll structure we will be using. | |
sock | The socket to add to the current poll structure. | |
event | The events to look for when we do the poll. One of: APR_POLLIN signal if read will not block APR_POLLPRI signal if prioirty data is availble to be read APR_POLLOUT signal if write will not block |
apr_status_t apr_poll_socket_clear | ( | apr_pollfd_t * | aprset, | |
apr_int16_t | events | |||
) |
Clear all events in the poll structure.
aprset | The poll structure we will be using. | |
events | The events to clear from all sockets. One of: APR_POLLIN signal if read will not block APR_POLLPRI signal if priority data is available to be read APR_POLLOUT signal if write will not block |
apr_status_t apr_poll_socket_mask | ( | apr_pollfd_t * | aprset, | |
apr_socket_t * | sock, | |||
apr_int16_t | events | |||
) |
Modify a socket in the poll structure with mask.
aprset | The poll structure we will be using. | |
sock | The socket to modify in poll structure. | |
events | The events to stop looking for during the poll. One of: APR_POLLIN signal if read will not block APR_POLLPRI signal if priority data is available to be read APR_POLLOUT signal if write will not block |
apr_status_t apr_poll_socket_remove | ( | apr_pollfd_t * | aprset, | |
apr_socket_t * | sock | |||
) |
Remove a socket from the poll structure.
aprset | The poll structure we will be using. | |
sock | The socket to remove from the current poll structure. |
apr_status_t apr_pollset_add | ( | apr_pollset_t * | pollset, | |
const apr_pollfd_t * | descriptor | |||
) |
Add a socket or file descriptor to a pollset
pollset | The pollset to which to add the descriptor | |
descriptor | The descriptor to add |
apr_status_t apr_pollset_create | ( | apr_pollset_t ** | pollset, | |
apr_uint32_t | size, | |||
apr_pool_t * | p, | |||
apr_uint32_t | flags | |||
) |
Setup a pollset object
pollset | The pointer in which to return the newly created object | |
size | The maximum number of descriptors that this pollset can hold | |
p | The pool from which to allocate the pollset | |
flags | Optional flags to modify the operation of the pollset (reserved for future expansion) |
apr_status_t apr_pollset_destroy | ( | apr_pollset_t * | pollset | ) |
Destroy a pollset object
pollset | The pollset to destroy |
apr_status_t apr_pollset_poll | ( | apr_pollset_t * | pollset, | |
apr_interval_time_t | timeout, | |||
apr_int32_t * | num, | |||
const apr_pollfd_t ** | descriptors | |||
) |
Block for activity on the descriptor(s) in a pollset
pollset | The pollset to use | |
timeout | Timeout in microseconds | |
num | Number of signalled descriptors (output parameter) | |
descriptors | Array of signalled descriptors (output parameter) |
apr_status_t apr_pollset_remove | ( | apr_pollset_t * | pollset, | |
const apr_pollfd_t * | descriptor | |||
) |
Remove a descriptor from a pollset
pollset | The pollset from which to remove the descriptor | |
descriptor | The descriptor to remove |