Poll Routines
[Apache Portability Runtime library]


Modules

 Poll options

Data Structures

union  apr_descriptor
struct  apr_pollfd_t

Typedefs

typedef apr_pollfd_t apr_pollfd_t
typedef apr_pollset_t apr_pollset_t

Enumerations

enum  apr_datatype_e { APR_NO_DESC, APR_POLL_SOCKET, APR_POLL_FILE, APR_POLL_LASTDESC }

Functions

apr_status_t apr_poll_setup (apr_pollfd_t **new_poll, apr_int32_t num, apr_pool_t *cont)
apr_status_t apr_poll (apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, apr_interval_time_t timeout)
apr_status_t apr_poll_socket_add (apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t event)
apr_status_t apr_poll_socket_mask (apr_pollfd_t *aprset, apr_socket_t *sock, apr_int16_t events)
apr_status_t apr_poll_socket_remove (apr_pollfd_t *aprset, apr_socket_t *sock)
apr_status_t apr_poll_socket_clear (apr_pollfd_t *aprset, apr_int16_t events)
apr_status_t apr_poll_revents_get (apr_int16_t *event, apr_socket_t *sock, apr_pollfd_t *aprset)
apr_status_t apr_pollset_create (apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags)
apr_status_t apr_pollset_destroy (apr_pollset_t *pollset)
apr_status_t apr_pollset_add (apr_pollset_t *pollset, const apr_pollfd_t *descriptor)
apr_status_t apr_pollset_remove (apr_pollset_t *pollset, const apr_pollfd_t *descriptor)
apr_status_t apr_pollset_poll (apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, const apr_pollfd_t **descriptors)

Typedef Documentation

typedef struct apr_pollfd_t apr_pollfd_t

See also:
apr_pollfd_t

typedef struct apr_pollset_t apr_pollset_t

Opaque structure used for pollset API


Enumeration Type Documentation

enum apr_datatype_e

Used in apr_pollfd_t to determine what the apr_descriptor is

Enumerator:
APR_NO_DESC  nothing here
APR_POLL_SOCKET  descriptor refers to a socket
APR_POLL_FILE  descriptor refers to a file
APR_POLL_LASTDESC  descriptor is the last one in the list


Function Documentation

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

Parameters:
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.
Remarks:
 The number of sockets signalled is returned in the second argument.
This is a blocking call, and it will not return until either a socket has been signalled, or the timeout has expired.

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.

Parameters:
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.
Deprecated:
This function is deprecated, APR applications should control the pollset memory themselves.

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

Parameters:
new_poll The poll structure to be used.
num The number of socket descriptors to be polled.
cont The pool to operate on.
Deprecated:
This function is deprecated, APR applications should control the pollset memory themselves.

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.

Parameters:
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
 
Deprecated:
This function is deprecated, APR applications should control the pollset memory themselves.

apr_status_t apr_poll_socket_clear ( apr_pollfd_t aprset,
apr_int16_t  events 
)

Clear all events in the poll structure.

Parameters:
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
 
Deprecated:
This function is deprecated, APR applications should control the pollset memory themselves.

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.

Parameters:
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
 
Deprecated:
This function is deprecated, APR applications should control the pollset memory themselves.

apr_status_t apr_poll_socket_remove ( apr_pollfd_t aprset,
apr_socket_t sock 
)

Remove a socket from the poll structure.

Parameters:
aprset The poll structure we will be using.
sock The socket to remove from the current poll structure.
Deprecated:
This function is deprecated, APR applications should control the pollset memory themselves.

apr_status_t apr_pollset_add ( apr_pollset_t pollset,
const apr_pollfd_t descriptor 
)

Add a socket or file descriptor to a pollset

Parameters:
pollset The pollset to which to add the descriptor
descriptor The descriptor to add
Remarks:
If you set client_data in the descriptor, that value will be returned in the client_data field whenever this descriptor is signalled in apr_pollset_poll().

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

Parameters:
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

Parameters:
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

Parameters:
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

Parameters:
pollset The pollset from which to remove the descriptor
descriptor The descriptor to remove


Generated on Mon Nov 26 11:47:27 2007 for Apache Portable Runtime by  doxygen 1.5.2