org.apache.tomcat.jni
public class Poll extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
APR_NO_DESC
Used in apr_pollfd_t to determine what the apr_descriptor is
apr_datatype_e enum
|
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
|
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
|
| Constructor and Description |
|---|
Poll() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static final int APR_POLLIN
public static final int APR_POLLPRI
public static final int APR_POLLOUT
public static final int APR_POLLERR
public static final int APR_POLLHUP
public static final int APR_POLLNVAL
public static final int APR_POLLSET_THREADSAFE
public static final int APR_NO_DESC
public static final int APR_POLL_SOCKET
public static final int APR_POLL_FILE
public static final int APR_POLL_LASTDESC
public static long create(int size,
long p,
int flags,
long ttl)
throws Error
size - The maximum number of descriptors that this pollset can holdp - The pool from which to allocate the pollsetflags - Optional flags to modify the operation of the pollset.ttl - Maximum time to live for a particular socket.Errorpublic static int destroy(long pollset)
pollset - The pollset to destroypublic static int add(long pollset,
long sock,
int reqevents)
pollset - The pollset to which to add the descriptorsock - The sockets to addreqevents - requested eventspublic static int remove(long pollset,
long sock)
pollset - The pollset from which to remove the descriptorsock - The socket to removepublic static int poll(long pollset,
long timeout,
long[] descriptors,
boolean remove)
pollset - The pollset to usetimeout - Timeout in microsecondsdescriptors - 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 pollsetpublic static int maintain(long pollset,
long[] descriptors,
boolean remove)
pollset - The pollset to usedescriptors - 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 pollsetpublic static void setTtl(long pollset,
long ttl)
pollset - The pollset to usettl - Timeout in microsecondspublic static long getTtl(long pollset)
pollset - The pollset to usepublic static int pollset(long pollset,
long[] descriptors)
pollset - The pollset to usedescriptors - 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
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.