Package org.apache.tomcat.jni
Class Poll
java.lang.Object
org.apache.tomcat.jni.Poll
Deprecated.
The scope of the APR/Native Library will be reduced in Tomcat
              10.1.x / Tomcat Native 2.x onwards to only include those
              components required to provide OpenSSL integration with the NIO
              and NIO2 connectors.
Poll
- Author:
- Mladen Turk
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDeprecated.nothing herestatic final intDeprecated.descriptor refers to a filestatic final intDeprecated.descriptor is the last one in the liststatic final intDeprecated.descriptor refers to a socketstatic final intDeprecated.Pending errorstatic final intDeprecated.Hangup occurredstatic final intDeprecated.Can read without blockingstatic final intDeprecated.Descriptor invalidstatic final intDeprecated.Can write without blockingstatic final intDeprecated.Priority data availablestatic final intDeprecated.Adding or Removing a Descriptor is thread safe
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic intadd(long pollset, long sock, int reqevents) Deprecated.Add a socket to a pollset with the default timeout.static intaddWithTimeout(long pollset, long sock, int reqevents, long timeout) Deprecated.Add a socket to a pollset with a specific timeout.static longcreate(int size, long p, int flags, long ttl) Deprecated.Setup a pollset object.static intdestroy(long pollset) Deprecated.Destroy a pollset objectstatic longgetTtl(long pollset) Deprecated.Get the socket time to live.static intinterrupt(long pollset) Deprecated.Make poll() return.static intmaintain(long pollset, long[] descriptors, boolean remove) Deprecated.Maintain on the descriptor(s) in a pollsetstatic intpoll(long pollset, long timeout, long[] descriptors, boolean remove) Deprecated.Block for activity on the descriptor(s) in a pollsetstatic intpollset(long pollset, long[] descriptors) Deprecated.Return all descriptor(s) in a pollsetstatic intremove(long pollset, long sock) Deprecated.Remove a descriptor from a pollsetstatic voidsetTtl(long pollset, long ttl) Deprecated.Set the socket time to live.static booleanwakeable(long pollset) Deprecated.Check if interrupt() is allowed.
- 
Field Details- 
APR_POLLINpublic static final int APR_POLLINDeprecated.Can read without blocking- See Also:
 
- 
APR_POLLPRIpublic static final int APR_POLLPRIDeprecated.Priority data available- See Also:
 
- 
APR_POLLOUTpublic static final int APR_POLLOUTDeprecated.Can write without blocking- See Also:
 
- 
APR_POLLERRpublic static final int APR_POLLERRDeprecated.Pending error- See Also:
 
- 
APR_POLLHUPpublic static final int APR_POLLHUPDeprecated.Hangup occurred- See Also:
 
- 
APR_POLLNVALpublic static final int APR_POLLNVALDeprecated.Descriptor invalid- See Also:
 
- 
APR_POLLSET_THREADSAFEpublic static final int APR_POLLSET_THREADSAFEDeprecated.Adding or Removing a Descriptor is thread safe- See Also:
 
- 
APR_NO_DESCpublic static final int APR_NO_DESCDeprecated.nothing here- See Also:
 
- 
APR_POLL_SOCKETpublic static final int APR_POLL_SOCKETDeprecated.descriptor refers to a socket- See Also:
 
- 
APR_POLL_FILEpublic static final int APR_POLL_FILEDeprecated.descriptor refers to a file- See Also:
 
- 
APR_POLL_LASTDESCpublic static final int APR_POLL_LASTDESCDeprecated.descriptor is the last one in the list- See Also:
 
 
- 
- 
Constructor Details- 
Pollpublic Poll()Deprecated.
 
- 
- 
Method Details- 
createDeprecated.Setup a pollset object. If flags equals APR_POLLSET_THREADSAFE, then a pollset is created on which it is safe to make concurrent calls to apr_pollset_add(), apr_pollset_remove() and apr_pollset_poll() from separate threads. This feature is only supported on some platforms; the apr_pollset_create() call will fail with APR_ENOTIMPL on platforms where it is not supported.- 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
- Throws:
- Error- Pollset creation failed
 
- 
destroypublic static int destroy(long pollset) Deprecated.Destroy a pollset object- Parameters:
- pollset- The pollset to destroy
- Returns:
- the operation status
 
- 
addpublic static int add(long pollset, long sock, int reqevents) Deprecated.Add a socket to a pollset with the default timeout.- Parameters:
- pollset- The pollset to which to add the socket
- sock- The sockets to add
- reqevents- requested events
- Returns:
- the operation status
 
- 
addWithTimeoutpublic static int addWithTimeout(long pollset, long sock, int reqevents, long timeout) Deprecated.Add a socket to a pollset with a specific timeout.- Parameters:
- pollset- The pollset to which to add the socket
- sock- The sockets to add
- reqevents- requested events
- timeout- requested timeout in microseconds (-1 for infinite)
- Returns:
- the operation status
 
- 
removepublic static int remove(long pollset, long sock) Deprecated.Remove a descriptor from a pollset- Parameters:
- pollset- The pollset from which to remove the descriptor
- sock- The socket to remove
- Returns:
- the operation status
 
- 
pollpublic static int poll(long pollset, long timeout, long[] descriptors, boolean remove) Deprecated.Block for activity on the descriptor(s) in a pollset- Parameters:
- pollset- The pollset to use
- timeout- Timeout in microseconds
- descriptors- Array of signaled descriptors (output parameter) The descriptor array must be two times the size of pollset. and are populated as follows:- descriptors[2n + 0] -> returned events descriptors[2n + 1] -> socket 
- remove- Remove signaled descriptors from pollset
- Returns:
- Number of signaled descriptors (output parameter) or negative APR error code.
 
- 
maintainpublic static int maintain(long pollset, long[] descriptors, boolean remove) Deprecated.Maintain on the descriptor(s) in a pollset- Parameters:
- pollset- The pollset to use
- descriptors- Array of signaled descriptors (output parameter) The descriptor array must be the size of pollset. and are populated as follows:- descriptors[n] -> socket 
- remove- Remove signaled descriptors from pollset
- Returns:
- Number of signaled descriptors (output parameter) or negative APR error code.
 
- 
setTtlpublic static void setTtl(long pollset, long ttl) Deprecated.Set the socket time to live.- Parameters:
- pollset- The pollset to use
- ttl- Timeout in microseconds
 
- 
getTtlpublic static long getTtl(long pollset) Deprecated.Get the socket time to live.- Parameters:
- pollset- The pollset to use
- Returns:
- Timeout in microseconds
 
- 
pollsetpublic static int pollset(long pollset, long[] descriptors) Deprecated.Return all descriptor(s) in a pollset- Parameters:
- pollset- The pollset to use
- descriptors- Array of descriptors (output parameter) The descriptor array must be two times the size of pollset. and are populated as follows:- descriptors[2n + 0] -> returned events descriptors[2n + 1] -> socket 
- Returns:
- Number of descriptors (output parameter) in the Poll or negative APR error code.
 
- 
interruptpublic static int interrupt(long pollset) Deprecated.Make poll() return.- Parameters:
- pollset- The pollset to use
- Returns:
- Negative APR error code
 
- 
wakeablepublic static boolean wakeable(long pollset) Deprecated.Check if interrupt() is allowed.- Parameters:
- pollset- The pollset to use
- Returns:
- trueif- interrupt(long)is allowed, else- false
 
 
-