Package org.apache.tomcat.jni
Class Socket
- java.lang.Object
- 
- org.apache.tomcat.jni.Socket
 
- 
 @Deprecated public class Socket extends java.lang.ObjectDeprecated.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.Socket- Author:
- Mladen Turk
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intAPR_INCOMPLETE_READDeprecated.Set on non-blocking sockets (timeout !static intAPR_INCOMPLETE_WRITEDeprecated.like APR_INCOMPLETE_READ, but for writestatic intAPR_INETDeprecated.static intAPR_INET6Deprecated.static intAPR_IPV4_ADDR_OKDeprecated.static intAPR_IPV6_ADDR_OKDeprecated.static intAPR_IPV6_V6ONLYDeprecated.Don't accept IPv4 connections on an IPv6 listening socket.static intAPR_LOCALDeprecated.Enum to tell us if we're interested in remote or local socket apr_interface_estatic intAPR_PROTO_SCTPDeprecated.SCTPstatic intAPR_PROTO_TCPDeprecated.TCPstatic intAPR_PROTO_UDPDeprecated.UDPstatic intAPR_REMOTEDeprecated.static intAPR_RESET_NODELAYDeprecated.This flag is ONLY set internally when we set APR_TCP_NOPUSH with APR_TCP_NODELAY set to tell us that APR_TCP_NODELAY should be turned on again when NOPUSH is turned offstatic intAPR_SHUTDOWN_READDeprecated.no longer allow read requeststatic intAPR_SHUTDOWN_READWRITEDeprecated.no longer allow read or write requestsstatic intAPR_SHUTDOWN_WRITEDeprecated.no longer allow write requestsstatic intAPR_SO_DEBUGDeprecated.Debugstatic intAPR_SO_DISCONNECTEDDeprecated.Disconnectedstatic intAPR_SO_KEEPALIVEDeprecated.Keepalivestatic intAPR_SO_LINGERDeprecated.Lingerstatic intAPR_SO_NONBLOCKDeprecated.Non-blocking IOstatic intAPR_SO_RCVBUFDeprecated.Receive bufferstatic intAPR_SO_REUSEADDRDeprecated.Reuse addressesstatic intAPR_SO_SNDBUFDeprecated.Send bufferstatic intAPR_TCP_DEFER_ACCEPTDeprecated.Delay accepting of new connections until data is available.static intAPR_TCP_NODELAYDeprecated.For SCTP sockets, this is mapped to STCP_NODELAY internally.static intAPR_TCP_NOPUSHDeprecated.No pushstatic intAPR_UNIXDeprecated.static intAPR_UNSPECDeprecated.static intSOCK_DGRAMDeprecated.static intSOCK_STREAMDeprecated.static intSOCKET_GET_APRSDeprecated.static intSOCKET_GET_IMPLDeprecated.static intSOCKET_GET_POOLDeprecated.static intSOCKET_GET_TYPEDeprecated.
 - 
Constructor SummaryConstructors Constructor Description Socket()Deprecated.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static longaccept(long sock)Deprecated.Accept a new connection requeststatic intacceptfilter(long sock, java.lang.String name, java.lang.String args)Deprecated.Set an OS level accept filter.static longacceptx(long sock, long pool)Deprecated.Accept a new connection requeststatic booleanatmark(long sock)Deprecated.Query the specified socket if at the OOB/Urgent data markstatic intbind(long sock, long sa)Deprecated.Bind the socket to its associated portstatic intclose(long thesocket)Deprecated.Close a socket.static intconnect(long sock, long sa)Deprecated.Issue a connection request to a socket either on the same machine or a different one.static longcreate(int family, int type, int protocol, long cont)Deprecated.Create a socket.static java.lang.ObjectdataGet(long sock, java.lang.String key)Deprecated.Return the data associated with the current socketstatic intdataSet(long sock, java.lang.String key, java.lang.Object data)Deprecated.Set the data associated with the current socket.static voiddestroy(long thesocket)Deprecated.Destroy a pool associated with socketstatic intlisten(long sock, int backlog)Deprecated.Listen to a bound socket for connections.static intoptGet(long sock, int opt)Deprecated.Query socket options for the specified socketstatic intoptSet(long sock, int opt, int on)Deprecated.Setup socket options for the specified socketstatic longpool(long thesocket)Deprecated.Create a child pool from associated socket pool.static intrecv(long sock, byte[] buf, int offset, int nbytes)Deprecated.Read data from a network.static intrecvb(long sock, java.nio.ByteBuffer buf, int offset, int nbytes)Deprecated.Read data from a network.static intrecvbb(long sock, int offset, int nbytes)Deprecated.Read data from a network using internally set ByteBuffer.static intrecvbbt(long sock, int offset, int nbytes, long timeout)Deprecated.Read data from a network with timeout using internally set ByteBufferstatic intrecvbt(long sock, java.nio.ByteBuffer buf, int offset, int nbytes, long timeout)Deprecated.Read data from a network with timeout.static intrecvfrom(long from, long sock, int flags, byte[] buf, int offset, int nbytes)Deprecated.static intrecvt(long sock, byte[] buf, int offset, int nbytes, long timeout)Deprecated.Read data from a network with timeout.static intsend(long sock, byte[] buf, int offset, int len)Deprecated.Send data over a network.static intsendb(long sock, java.nio.ByteBuffer buf, int offset, int len)Deprecated.Send data over a network.static intsendbb(long sock, int offset, int len)Deprecated.Send data over a network using internally set ByteBufferstatic longsendfile(long sock, long file, byte[][] headers, byte[][] trailers, long offset, long len, int flags)Deprecated.Send a file from an open file descriptor to a socket, along with optional headers and trailers.static longsendfilen(long sock, long file, long offset, long len, int flags)Deprecated.Send a file without header and trailer arrays.static intsendib(long sock, java.nio.ByteBuffer buf, int offset, int len)Deprecated.Send data over a network without retrystatic intsendibb(long sock, int offset, int len)Deprecated.Send data over a network using internally set ByteBuffer without internal retry.static intsendto(long sock, long where, int flags, byte[] buf, int offset, int len)Deprecated.static intsendv(long sock, byte[][] vec)Deprecated.Send multiple packets of data over a network.static voidsetrbb(long sock, java.nio.ByteBuffer buf)Deprecated.Set internal receive ByteBuffer.static voidsetsbb(long sock, java.nio.ByteBuffer buf)Deprecated.Set internal send ByteBuffer.static intshutdown(long thesocket, int how)Deprecated.Shutdown either reading, writing, or both sides of a socket.static longtimeoutGet(long sock)Deprecated.Query socket timeout for the specified socketstatic inttimeoutSet(long sock, long t)Deprecated.Setup socket timeout for the specified socket
 
- 
- 
- 
Field Detail- 
SOCK_STREAMpublic static final int SOCK_STREAM Deprecated.- See Also:
- Constant Field Values
 
 - 
SOCK_DGRAMpublic static final int SOCK_DGRAM Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_SO_LINGERpublic static final int APR_SO_LINGER Deprecated.Linger- See Also:
- Constant Field Values
 
 - 
APR_SO_KEEPALIVEpublic static final int APR_SO_KEEPALIVE Deprecated.Keepalive- See Also:
- Constant Field Values
 
 - 
APR_SO_DEBUGpublic static final int APR_SO_DEBUG Deprecated.Debug- See Also:
- Constant Field Values
 
 - 
APR_SO_NONBLOCKpublic static final int APR_SO_NONBLOCK Deprecated.Non-blocking IO- See Also:
- Constant Field Values
 
 - 
APR_SO_REUSEADDRpublic static final int APR_SO_REUSEADDR Deprecated.Reuse addresses- See Also:
- Constant Field Values
 
 - 
APR_SO_SNDBUFpublic static final int APR_SO_SNDBUF Deprecated.Send buffer- See Also:
- Constant Field Values
 
 - 
APR_SO_RCVBUFpublic static final int APR_SO_RCVBUF Deprecated.Receive buffer- See Also:
- Constant Field Values
 
 - 
APR_SO_DISCONNECTEDpublic static final int APR_SO_DISCONNECTED Deprecated.Disconnected- See Also:
- Constant Field Values
 
 - 
APR_TCP_NODELAYpublic static final int APR_TCP_NODELAY Deprecated.For SCTP sockets, this is mapped to STCP_NODELAY internally.- See Also:
- Constant Field Values
 
 - 
APR_TCP_NOPUSHpublic static final int APR_TCP_NOPUSH Deprecated.No push- See Also:
- Constant Field Values
 
 - 
APR_RESET_NODELAYpublic static final int APR_RESET_NODELAY Deprecated.This flag is ONLY set internally when we set APR_TCP_NOPUSH with APR_TCP_NODELAY set to tell us that APR_TCP_NODELAY should be turned on again when NOPUSH is turned off- See Also:
- Constant Field Values
 
 - 
APR_INCOMPLETE_READpublic static final int APR_INCOMPLETE_READ Deprecated.Set on non-blocking sockets (timeout != 0) on which the previous read() did not fill a buffer completely. the next apr_socket_recv() will first call select()/poll() rather than going straight into read(). (Can also be set by an application to force a select()/poll() call before the next read, in cases where the app expects that an immediate read would fail.)- See Also:
- Constant Field Values
 
 - 
APR_INCOMPLETE_WRITEpublic static final int APR_INCOMPLETE_WRITE Deprecated.like APR_INCOMPLETE_READ, but for write- See Also:
- Constant Field Values
 
 - 
APR_IPV6_V6ONLYpublic static final int APR_IPV6_V6ONLY Deprecated.Don't accept IPv4 connections on an IPv6 listening socket.- See Also:
- Constant Field Values
 
 - 
APR_TCP_DEFER_ACCEPTpublic static final int APR_TCP_DEFER_ACCEPT Deprecated.Delay accepting of new connections until data is available.- See Also:
- Constant Field Values
 
 - 
APR_SHUTDOWN_READpublic static final int APR_SHUTDOWN_READ Deprecated.no longer allow read request- See Also:
- Constant Field Values
 
 - 
APR_SHUTDOWN_WRITEpublic static final int APR_SHUTDOWN_WRITE Deprecated.no longer allow write requests- See Also:
- Constant Field Values
 
 - 
APR_SHUTDOWN_READWRITEpublic static final int APR_SHUTDOWN_READWRITE Deprecated.no longer allow read or write requests- See Also:
- Constant Field Values
 
 - 
APR_IPV4_ADDR_OKpublic static final int APR_IPV4_ADDR_OK Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_IPV6_ADDR_OKpublic static final int APR_IPV6_ADDR_OK Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_UNSPECpublic static final int APR_UNSPEC Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_INETpublic static final int APR_INET Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_INET6public static final int APR_INET6 Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_UNIXpublic static final int APR_UNIX Deprecated.- See Also:
- Constant Field Values
 
 - 
APR_PROTO_TCPpublic static final int APR_PROTO_TCP Deprecated.TCP- See Also:
- Constant Field Values
 
 - 
APR_PROTO_UDPpublic static final int APR_PROTO_UDP Deprecated.UDP- See Also:
- Constant Field Values
 
 - 
APR_PROTO_SCTPpublic static final int APR_PROTO_SCTP Deprecated.SCTP- See Also:
- Constant Field Values
 
 - 
APR_LOCALpublic static final int APR_LOCAL Deprecated.Enum to tell us if we're interested in remote or local socket apr_interface_e- See Also:
- Constant Field Values
 
 - 
APR_REMOTEpublic static final int APR_REMOTE Deprecated.- See Also:
- Constant Field Values
 
 - 
SOCKET_GET_POOLpublic static final int SOCKET_GET_POOL Deprecated.- See Also:
- Constant Field Values
 
 - 
SOCKET_GET_IMPLpublic static final int SOCKET_GET_IMPL Deprecated.- See Also:
- Constant Field Values
 
 - 
SOCKET_GET_APRSpublic static final int SOCKET_GET_APRS Deprecated.- See Also:
- Constant Field Values
 
 - 
SOCKET_GET_TYPEpublic static final int SOCKET_GET_TYPE Deprecated.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createpublic static long create(int family, int type, int protocol, long cont) throws java.lang.ExceptionDeprecated.Create a socket.- Parameters:
- family- The address family of the socket (e.g., APR_INET).
- type- The type of the socket (e.g., SOCK_STREAM).
- protocol- The protocol of the socket (e.g., APR_PROTO_TCP).
- cont- The parent pool to use
- Returns:
- The new socket that has been set up.
- Throws:
- java.lang.Exception- Error creating socket
 
 - 
shutdownpublic static int shutdown(long thesocket, int how)Deprecated.Shutdown either reading, writing, or both sides of a socket.
 This does not actually close the socket descriptor, it just controls which calls are still valid on the socket.- Parameters:
- thesocket- The socket to close
- how- How to shutdown the socket. One of:- APR_SHUTDOWN_READ no longer allow read requests APR_SHUTDOWN_WRITE no longer allow write requests APR_SHUTDOWN_READWRITE no longer allow read or write requests 
- Returns:
- the operation status
 
 - 
closepublic static int close(long thesocket) Deprecated.Close a socket.- Parameters:
- thesocket- The socket to close
- Returns:
- the operation status
 
 - 
destroypublic static void destroy(long thesocket) Deprecated.Destroy a pool associated with socket- Parameters:
- thesocket- The destroy
 
 - 
bindpublic static int bind(long sock, long sa)Deprecated.Bind the socket to its associated port- Parameters:
- sock- The socket to bind
- sa- The socket address to bind to This may be where we will find out if there is any other process using the selected port.
- Returns:
- the operation status
 
 - 
listenpublic static int listen(long sock, int backlog)Deprecated.Listen to a bound socket for connections.- Parameters:
- sock- The socket to listen on
- backlog- The number of outstanding connections allowed in the sockets listen queue. If this value is less than zero, the listen queue size is set to zero.
- Returns:
- the operation status
 
 - 
acceptxpublic static long acceptx(long sock, long pool) throws java.lang.ExceptionDeprecated.Accept a new connection request- Parameters:
- sock- The socket we are listening on.
- pool- The pool for the new socket.
- Returns:
- A copy of the socket that is connected to the socket that made the connection request. This is the socket which should be used for all future communication.
- Throws:
- java.lang.Exception- Socket accept error
 
 - 
acceptpublic static long accept(long sock) throws java.lang.ExceptionDeprecated.Accept a new connection request- Parameters:
- sock- The socket we are listening on.
- Returns:
- A copy of the socket that is connected to the socket that made the connection request. This is the socket which should be used for all future communication.
- Throws:
- java.lang.Exception- Socket accept error
 
 - 
acceptfilterpublic static int acceptfilter(long sock, java.lang.String name, java.lang.String args)Deprecated.Set an OS level accept filter.- Parameters:
- sock- The socket to put the accept filter on.
- name- The accept filter
- args- Any extra args to the accept filter. Passing NULL here removes the accept filter.
- Returns:
- the operation status
 
 - 
atmarkpublic static boolean atmark(long sock) Deprecated.Query the specified socket if at the OOB/Urgent data mark- Parameters:
- sock- The socket to query
- Returns:
- trueif socket is at the OOB/urgent mark, otherwise- false.
 
 - 
connectpublic static int connect(long sock, long sa)Deprecated.Issue a connection request to a socket either on the same machine or a different one.- Parameters:
- sock- The socket we wish to use for our side of the connection
- sa- The address of the machine we wish to connect to.
- Returns:
- the operation status
 
 - 
sendpublic static int send(long sock, byte[] buf, int offset, int len)Deprecated.Send data over a network.This functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. It is possible for both bytes to be sent and an error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to send the data over.
- buf- The buffer which contains the data to be sent.
- offset- Offset in the byte buffer.
- len- The number of bytes to write; (-1) for full array.
- Returns:
- The number of bytes sent
 
 - 
sendbpublic static int sendb(long sock, java.nio.ByteBuffer buf, int offset, int len)Deprecated.Send data over a network.This functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. It is possible for both bytes to be sent and an error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to send the data over.
- buf- The Byte buffer which contains the data to be sent.
- offset- The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than buf.length
- len- The maximum number of buffers to be accessed; must be non-negative and no larger than buf.length - offset
- Returns:
- The number of bytes sent
 
 - 
sendibpublic static int sendib(long sock, java.nio.ByteBuffer buf, int offset, int len)Deprecated.Send data over a network without retryThis functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. It is possible for both bytes to be sent and an error to be returned. - Parameters:
- sock- The socket to send the data over.
- buf- The Byte buffer which contains the data to be sent.
- offset- The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than buf.length
- len- The maximum number of buffers to be accessed; must be non-negative and no larger than buf.length - offset
- Returns:
- The number of bytes sent
 
 - 
sendbbpublic static int sendbb(long sock, int offset, int len)Deprecated.Send data over a network using internally set ByteBuffer- Parameters:
- sock- The socket to send the data over.
- offset- The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than buf.length
- len- The maximum number of buffers to be accessed; must be non-negative and no larger than buf.length - offset
- Returns:
- The number of bytes sent
 
 - 
sendibbpublic static int sendibb(long sock, int offset, int len)Deprecated.Send data over a network using internally set ByteBuffer without internal retry.- Parameters:
- sock- The socket to send the data over.
- offset- The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than buf.length
- len- The maximum number of buffers to be accessed; must be non-negative and no larger than buf.length - offset
- Returns:
- The number of bytes sent
 
 - 
sendvpublic static int sendv(long sock, byte[][] vec)Deprecated.Send multiple packets of data over a network.This functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually sent is stored in argument 3. It is possible for both bytes to be sent and an error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to send the data over.
- vec- The array from which to get the data to send.
- Returns:
- The number of bytes sent
 
 - 
sendtopublic static int sendto(long sock, long where, int flags, byte[] buf, int offset, int len)Deprecated.- Parameters:
- sock- The socket to send from
- where- The apr_sockaddr_t describing where to send the data
- flags- The flags to use
- buf- The data to send
- offset- Offset in the byte buffer.
- len- The length of the data to send
- Returns:
- The number of bytes sent
 
 - 
recvpublic static int recv(long sock, byte[] buf, int offset, int nbytes)Deprecated.Read data from a network.This functions acts like a blocking read by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually received is stored in argument 3. It is possible for both bytes to be received and an APR_EOF or other error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to read the data from.
- buf- The buffer to store the data in.
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- Returns:
- the number of bytes received.
 
 - 
recvtpublic static int recvt(long sock, byte[] buf, int offset, int nbytes, long timeout)Deprecated.Read data from a network with timeout.This functions acts like a blocking read by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually received is stored in argument 3. It is possible for both bytes to be received and an APR_EOF or other error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to read the data from.
- buf- The buffer to store the data in.
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- timeout- The socket timeout in microseconds.
- Returns:
- the number of bytes received.
 
 - 
recvbpublic static int recvb(long sock, java.nio.ByteBuffer buf, int offset, int nbytes)Deprecated.Read data from a network.This functions acts like a blocking read by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually received is stored in argument 3. It is possible for both bytes to be received and an APR_EOF or other error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to read the data from.
- buf- The buffer to store the data in.
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- Returns:
- If ≥ 0, the return value is the number of bytes read. Note a
         non-blocking read with no data current available will return
         Status.EAGAINand EOF will returnStatus.APR_EOF.
 
 - 
recvbbpublic static int recvbb(long sock, int offset, int nbytes)Deprecated.Read data from a network using internally set ByteBuffer.- Parameters:
- sock- The socket to read the data from.
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- Returns:
- If > 0, the return value is the number of bytes read. If == 0,
         the return value indicates EOF and if < 0 the return value is the
         error code. Note a non-blocking read with no data current
         available will return Status.EAGAINnot zero.
 
 - 
recvbtpublic static int recvbt(long sock, java.nio.ByteBuffer buf, int offset, int nbytes, long timeout)Deprecated.Read data from a network with timeout.This functions acts like a blocking read by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually received is stored in argument 3. It is possible for both bytes to be received and an APR_EOF or other error to be returned. APR_EINTR is never returned. - Parameters:
- sock- The socket to read the data from.
- buf- The buffer to store the data in.
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- timeout- The socket timeout in microseconds.
- Returns:
- the number of bytes received.
 
 - 
recvbbtpublic static int recvbbt(long sock, int offset, int nbytes, long timeout)Deprecated.Read data from a network with timeout using internally set ByteBuffer- Parameters:
- sock- The socket to read the data from.
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- timeout- The socket timeout in microseconds.
- Returns:
- the number of bytes received.
 
 - 
recvfrompublic static int recvfrom(long from, long sock, int flags, byte[] buf, int offset, int nbytes)Deprecated.- Parameters:
- from- The apr_sockaddr_t to fill in the recipient info
- sock- The socket to use
- flags- The flags to use
- buf- The buffer to use
- offset- Offset in the byte buffer.
- nbytes- The number of bytes to read (-1) for full array.
- Returns:
- the number of bytes received.
 
 - 
optSetpublic static int optSet(long sock, int opt, int on)Deprecated.Setup socket options for the specified socket- Parameters:
- sock- The socket to set up.
- opt- The option we would like to configure. One of:- APR_SO_DEBUG -- turn on debugging information APR_SO_KEEPALIVE -- keep connections active APR_SO_LINGER -- lingers on close if data is present APR_SO_NONBLOCK -- Turns blocking on/off for socket When this option is enabled, use the APR_STATUS_IS_EAGAIN() macro to see if a send or receive function could not transfer data without blocking. APR_SO_REUSEADDR -- The rules used in validating addresses supplied to bind should allow reuse of local addresses. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize
- on- Value for the option.
- Returns:
- the operation status
 
 - 
optGetpublic static int optGet(long sock, int opt) throws java.lang.ExceptionDeprecated.Query socket options for the specified socket- Parameters:
- sock- The socket to query
- opt- The option we would like to query. One of:- APR_SO_DEBUG -- turn on debugging information APR_SO_KEEPALIVE -- keep connections active APR_SO_LINGER -- lingers on close if data is present APR_SO_NONBLOCK -- Turns blocking on/off for socket APR_SO_REUSEADDR -- The rules used in validating addresses supplied to bind should allow reuse of local addresses. APR_SO_SNDBUF -- Set the SendBufferSize APR_SO_RCVBUF -- Set the ReceiveBufferSize APR_SO_DISCONNECTED -- Query the disconnected state of the socket. (Currently only used on Windows)
- Returns:
- Socket option returned on the call.
- Throws:
- java.lang.Exception- An error occurred
 
 - 
timeoutSetpublic static int timeoutSet(long sock, long t)Deprecated.Setup socket timeout for the specified socket- Parameters:
- sock- The socket to set up.
- t- Value for the timeout in microseconds.- t > 0 -- read and write calls return APR_TIMEUP if specified time elapses with no data read or written t == 0 -- read and write calls never block t < 0 -- read and write calls block
- Returns:
- the operation status
 
 - 
timeoutGetpublic static long timeoutGet(long sock) throws java.lang.ExceptionDeprecated.Query socket timeout for the specified socket- Parameters:
- sock- The socket to query
- Returns:
- Socket timeout returned from the query.
- Throws:
- java.lang.Exception- An error occurred
 
 - 
sendfilepublic static long sendfile(long sock, long file, byte[][] headers, byte[][] trailers, long offset, long len, int flags)Deprecated.Send a file from an open file descriptor to a socket, along with optional headers and trailers.
 This functions acts like a blocking write by default. To change this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK socket option. The number of bytes actually sent is stored in the len parameter. The offset parameter is passed by reference for no reason; its value will never be modified by the apr_socket_sendfile() function.- Parameters:
- sock- The socket to which we're writing
- file- The open file from which to read
- headers- Array containing the headers to send
- trailers- Array containing the trailers to send
- offset- Offset into the file where we should begin writing
- len- Number of bytes to send from the file
- flags- APR flags that are mapped to OS specific flags
- Returns:
- Number of bytes actually sent, including headers, file, and trailers
 
 - 
sendfilenpublic static long sendfilen(long sock, long file, long offset, long len, int flags)Deprecated.Send a file without header and trailer arrays.- Parameters:
- sock- The socket to which we're writing
- file- The open file from which to read
- offset- Offset into the file where we should begin writing
- len- Number of bytes to send from the file
- flags- APR flags that are mapped to OS specific flags
- Returns:
- Number of bytes actually sent
 
 - 
poolpublic static long pool(long thesocket) throws java.lang.ExceptionDeprecated.Create a child pool from associated socket pool.- Parameters:
- thesocket- The socket to use
- Returns:
- a pointer to the pool
- Throws:
- java.lang.Exception- An error occurred
 
 - 
setsbbpublic static void setsbb(long sock, java.nio.ByteBuffer buf)Deprecated.Set internal send ByteBuffer. This function will preset internal Java ByteBuffer for consecutive sendbb calls.- Parameters:
- sock- The socket to use
- buf- The ByteBuffer
 
 - 
setrbbpublic static void setrbb(long sock, java.nio.ByteBuffer buf)Deprecated.Set internal receive ByteBuffer. This function will preset internal Java ByteBuffer for consecutive revcvbb/recvbbt calls.- Parameters:
- sock- The socket to use
- buf- The ByteBuffer
 
 - 
dataSetpublic static int dataSet(long sock, java.lang.String key, java.lang.Object data)Deprecated.Set the data associated with the current socket.- Parameters:
- sock- The currently open socket.
- data- The user data to associate with the socket.
- key- The key to associate with the data.
- Returns:
- the operation status
 
 - 
dataGetpublic static java.lang.Object dataGet(long sock, java.lang.String key)Deprecated.Return the data associated with the current socket- Parameters:
- sock- The currently open socket.
- key- The key to associate with the user data.
- Returns:
- Data or null in case of error.
 
 
- 
 
-