org.apache.tomcat.jni
public class Poll extends Object
Version: $Revision: 815818 $, $Date: 2009-09-16 16:56:50 +0200 (Wed, 16 Sep 2009) $
Field Summary | |
---|---|
static int | APR_NO_DESC Used in apr_pollfd_t to determine what the apr_descriptor is
apr_datatype_e enum |
static int | APR_POLLERR Can write without blocking |
static int | APR_POLLHUP Pending error |
static int | APR_POLLIN
Poll options |
static int | APR_POLLNVAL Hangup occurred |
static int | APR_POLLOUT Priority data available |
static int | APR_POLLPRI Can read without blocking |
static int | APR_POLLSET_THREADSAFE Adding or Removing a Descriptor is thread safe |
static int | APR_POLL_FILE descriptor refers to a socket |
static int | APR_POLL_LASTDESC descriptor refers to a file |
static int | APR_POLL_SOCKET nothing here |
Method Summary | |
---|---|
static int | add(long pollset, long sock, int reqevents)
Add a socket or to a pollset
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(). |
static long | create(int size, long p, int flags, long ttl)
Setup a pollset object.
|
static int | destroy(long pollset)
Destroy a pollset object |
static long | getTtl(long pollset)
Get the socket time to live. |
static int | maintain(long pollset, long[] descriptors, boolean remove)
Maintain on the descriptor(s) in a pollset |
static int | poll(long pollset, long timeout, long[] descriptors, boolean remove)
Block for activity on the descriptor(s) in a pollset |
static int | pollset(long pollset, long[] descriptors)
Return all descriptor(s) in a pollset |
static int | remove(long pollset, long sock)
Remove a descriptor from a pollset |
static void | setTtl(long pollset, long ttl)
Set the socket time to live. |
Parameters: pollset The pollset to which to add the descriptor sock The sockets to add reqevents requested events
Parameters: 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. ttl Maximum time to live for a particular socket.
Returns: The pointer in which to return the newly created object
Parameters: pollset The pollset to destroy
Parameters: pollset The pollset to use
Returns: Timeout in microseconds
Parameters: pollset The pollset to use descriptors Array of signalled descriptors (output parameter)
The desctiptor array must be the size of pollset.
and are populated as follows:
descriptors[n] -> socket
remove Remove signaled descriptors from pollset
Returns: Number of signalled descriptors (output parameter) or negative APR error code.
Parameters: pollset The pollset to use timeout Timeout in microseconds descriptors Array of signalled descriptors (output parameter)
The desctiptor array must be two times the size of pollset.
and are populated as follows:
descriptors[n + 0] -> returned events
descriptors[n + 1] -> socket
remove Remove signaled descriptors from pollset
Returns: Number of signalled descriptors (output parameter) or negative APR error code.
Parameters: pollset The pollset to use descriptors Array of descriptors (output parameter)
The desctiptor array must be two times the size of pollset.
and are populated as follows:
descriptors[n + 0] -> returned events
descriptors[n + 1] -> socket
Returns: Number of descriptors (output parameter) in the Poll or negative APR error code.
Parameters: pollset The pollset from which to remove the descriptor sock The socket to remove
Parameters: pollset The pollset to use ttl Timeout in microseconds