Class AprEndpoint

    • Field Detail

      • rootPool

        protected long rootPool
        Root APR memory pool.
      • serverSock

        protected volatile long serverSock
        Server socket "pointer".
      • serverSockPool

        protected long serverSockPool
        APR memory pool for the server socket.
      • sslContext

        protected long sslContext
        SSL context.
      • deferAccept

        protected boolean deferAccept
        Defer accept.
      • sendfileSize

        protected int sendfileSize
        Size of the sendfile (= concurrent files which can be served).
      • pollTime

        protected int pollTime
        Poll interval, in microseconds. The smaller the value, the more CPU the poller will use, but the more responsive to activity it will be.
    • Constructor Detail

      • AprEndpoint

        public AprEndpoint()
    • Method Detail

      • setDeferAccept

        public void setDeferAccept​(boolean deferAccept)
      • setIpv6v6only

        public void setIpv6v6only​(boolean ipv6v6only)
      • getIpv6v6only

        public boolean getIpv6v6only()
      • setSendfileSize

        public void setSendfileSize​(int sendfileSize)
      • getSendfileSize

        public int getSendfileSize()
      • getPollTime

        public int getPollTime()
      • setPollTime

        public void setPollTime​(int pollTime)
      • getLocalAddress

        public InetSocketAddress getLocalAddress()
                                          throws IOException
        Description copied from class: AbstractEndpoint
        Obtain the network address the server socket is bound to. This primarily exists to enable the correct address to be used when unlocking the server socket since it removes the guess-work involved if no address is specifically set.
        Specified by:
        getLocalAddress in class AbstractEndpoint<Long,​Long>
        The network address that the server socket is listening on or null if the server socket is not currently bound.
        IOException - If there is a problem determining the currently bound socket
      • setMaxConnections

        public void setMaxConnections​(int maxConnections)
        This endpoint does not support -1 for unlimited connections, nor does it support setting this attribute while the endpoint is running.
        setMaxConnections in class AbstractEndpoint<Long,​Long>
      • getUnixDomainSocketPath

        public String getUnixDomainSocketPath()
      • setUnixDomainSocketPath

        public void setUnixDomainSocketPath​(String unixDomainSocketPath)
      • getUnixDomainSocketPathPermissions

        public String getUnixDomainSocketPathPermissions()
      • setUnixDomainSocketPathPermissions

        public void setUnixDomainSocketPathPermissions​(String unixDomainSocketPathPermissions)
      • getKeepAliveCount

        public int getKeepAliveCount()
        Obtain the number of kept alive sockets.
        The number of open sockets currently managed by the Poller
      • getSendfileCount

        public int getSendfileCount()
        Obtain the number of sendfile sockets.
        The number of sockets currently managed by the Sendfile poller.
      • getId

        public String getId()
        Description copied from class: AbstractEndpoint
        The default behavior is to identify connectors uniquely with address and port. However, certain connectors are not using that and need some other identifier, which then can be used as a replacement.
        getId in class AbstractEndpoint<Long,​Long>
        the id
      • createSSLContext

        protected void createSSLContext​(SSLHostConfig sslHostConfig)
                                 throws Exception
        Description copied from class: AbstractEndpoint
        Create the SSLContextfor the the given SSLHostConfig.
        Specified by:
        createSSLContext in class AbstractEndpoint<Long,​Long>
        sslHostConfig - The SSLHostConfig for which the SSLContext should be created
        Exception - If the SSLContext cannot be created for the given SSLHostConfig
      • getSslContext

        public long getSslContext​(String sniHostName)
        Description copied from interface: SSLContext.SNICallBack
        This callback is made during the TLS handshake when the client uses the SNI extension to request a specific TLS host.
        Specified by:
        getSslContext in interface SSLContext.SNICallBack
        sniHostName - The host name requested by the client - must be in lower case
        The Java representation of the pointer to the OpenSSL SSLContext to use for the given host or zero if no SSLContext could be identified
      • setSocketOptions

        protected boolean setSocketOptions​(SocketWrapperBase<Long> socketWrapper)
        Process the specified connection.
        socketWrapper - The socket wrapper
        true if the socket was correctly configured and processing may continue, false if the socket needs to be close immediately
      • allocatePoller

        protected long allocatePoller​(int size,
                                      long pool,
                                      int timeout)
        Allocate a new poller of the specified size.
        size - The size
        pool - The pool from which the poller will be allocated
        timeout - The timeout
        the poller pointer
      • setSocketOptions

        protected boolean setSocketOptions​(Long socket)
        Process given socket. This is called when the socket has been accepted.
        Specified by:
        setSocketOptions in class AbstractEndpoint<Long,​Long>
        socket - The socket
        true if the socket was correctly configured and processing may continue, false if the socket needs to be close immediately
      • processSocket

        protected boolean processSocket​(long socket,
                                        SocketEvent event)
        Process the given socket. Typically keep alive or upgraded protocol.
        socket - The socket to process
        event - The event to process
        true if the processing completed normally otherwise false which indicates an error occurred and that the socket should be closed
      • destroySocket

        protected void destroySocket​(Long socket)
        Description copied from class: AbstractEndpoint
        Close the socket. This is used when the connector is not in a state which allows processing the socket, or if there was an error which prevented the allocation of the socket wrapper.
        Specified by:
        destroySocket in class AbstractEndpoint<Long,​Long>
        socket - The newly accepted socket