Package org.apache.tomcat.util.net
Class AbstractEndpoint<S,U>
- java.lang.Object
- 
- org.apache.tomcat.util.net.AbstractEndpoint<S,U>
 
- 
- Type Parameters:
- S- The type used by the socket wrapper associated with this endpoint. May be the same as U.
- U- The type of the underlying socket used by this endpoint. May be the same as S.
 - Direct Known Subclasses:
- AbstractJsseEndpoint,- AprEndpoint
 
 public abstract class AbstractEndpoint<S,U> extends java.lang.Object- Author:
- Mladen Turk, Remy Maucherat
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classAbstractEndpoint.BindStatestatic interfaceAbstractEndpoint.Handler<S>
 - 
Field SummaryFields Modifier and Type Field Description protected Acceptor<U>acceptorThread used to accept new connections and pass them to worker threads.protected intacceptorThreadCountDeprecated.This attribute is hard-coded to1and is no longer configurable.protected intacceptorThreadPriorityPriority of the acceptor threads.protected java.util.HashMap<java.lang.String,java.lang.Object>attributesAttributes provide a way for configuration to be passed to sub-components without theProtocolHandlerbeing aware of the properties available on those sub-components.protected java.util.Map<U,SocketWrapperBase<S>>connectionsMap holding all current connections keyed with the sockets.protected booleaninternalExecutorAre we using an internal executorprotected java.util.List<java.lang.String>negotiableProtocolsprotected booleanpausedWill be set to true whenever the endpoint is paused.protected SynchronizedStack<SocketProcessorBase<S>>processorCacheCache for SocketProcessor objectsprotected booleanrunningRunning state of the endpoint.protected static StringManagersmprotected SocketPropertiessocketPropertiesSocket propertiesprotected java.util.concurrent.ConcurrentMap<java.lang.String,SSLHostConfig>sslHostConfigsprotected intthreadPriorityPriority of the worker threads.
 - 
Constructor SummaryConstructors Constructor Description AbstractEndpoint()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddNegotiatedProtocol(java.lang.String negotiableProtocol)voidaddSslHostConfig(SSLHostConfig sslHostConfig)Add the given SSL Host configuration.voidaddSslHostConfig(SSLHostConfig sslHostConfig, boolean replace)Add the given SSL Host configuration, optionally replacing the existing configuration for the given host.longawaitConnectionsClose(long waitMillis)Wait for the client connections to the server to close gracefully.abstract voidbind()voidcloseServerSocketGraceful()protected voidcloseSocket(U socket)Close the socket when the connection has to be immediately closed when an error occurs while configuring the accepted socket or trying to dispatch it for processing.protected longcountDownConnection()protected voidcountUpOrAwaitConnection()voidcreateExecutor()protected abstract SocketProcessorBase<S>createSocketProcessor(SocketWrapperBase<S> socketWrapper, SocketEvent event)protected abstract voidcreateSSLContext(SSLHostConfig sslHostConfig)Create the SSLContext for the given SSLHostConfig.voiddestroy()protected abstract voiddestroySocket(U socket)Close the socket.protected voiddestroySsl()protected abstract voiddoCloseServerSocket()Actually close the server socket but don't perform any other clean-up.SSLHostConfig[]findSslHostConfigs()protected java.lang.StringgenerateCertificateDebug(java.security.cert.X509Certificate certificate)intgetAcceptCount()intgetAcceptorThreadCount()Deprecated.This attribute is hard-coded to1and is no longer configurable.intgetAcceptorThreadPriority()java.net.InetAddressgetAddress()java.lang.ObjectgetAttribute(java.lang.String key)Used by sub-components to retrieve configuration information.booleangetBindOnInit()protected AbstractEndpoint.BindStategetBindState()longgetConnectionCount()Return the current count of connections handled by this endpoint, if the connections are counted (which happens when the maximum count of connections is limited), or-1if they are not.intgetConnectionLinger()Socket linger.java.util.Set<SocketWrapperBase<S>>getConnections()Get a set with the current open connections.intgetConnectionTimeout()Socket timeout.intgetCurrentThreadCount()Return the amount of threads that are managed by the pool.intgetCurrentThreadsBusy()Return the amount of threads that are in usebooleangetDaemon()java.lang.StringgetDefaultSSLHostConfigName()protected abstract booleangetDeferAccept()java.lang.StringgetDomain()java.util.concurrent.ExecutorgetExecutor()longgetExecutorTerminationTimeoutMillis()AbstractEndpoint.Handler<S>getHandler()java.lang.StringgetId()The default behavior is to identify connectors uniquely with address and port.intgetKeepAliveTimeout()protected abstract java.net.InetSocketAddressgetLocalAddress()Obtain the network address the server socket is bound to.intgetLocalPort()protected abstract LoggetLog()protected LoggetLogCertificate()intgetMaxConnections()intgetMaxKeepAliveRequests()intgetMaxThreads()intgetMinSpareThreads()java.lang.StringgetName()intgetPort()intgetPortOffset()intgetPortWithOffset()java.lang.StringgetProperty(java.lang.String name)SocketPropertiesgetSocketProperties()protected SSLHostConfiggetSSLHostConfig(java.lang.String sniHostName)Look up the SSLHostConfig for the given host name.booleangetTcpNoDelay()Socket TCP no delay.intgetThreadPriority()booleangetUseAsyncIO()booleangetUseSendfile()booleangetUseVirtualThreads()java.util.concurrent.ScheduledExecutorServicegetUtilityExecutor()booleanhasNegotiableProtocols()voidinit()protected LimitLatchinitializeConnectionLatch()abstract booleanisAlpnSupported()Identifies if the endpoint supports ALPN.booleanisPaused()booleanisRunning()booleanisSSLEnabled()protected voidlogCertificate(SSLHostConfigCertificate certificate)voidpause()Pause the endpoint, which will stop it accepting new connections and unlock the acceptor.booleanprocessSocket(SocketWrapperBase<S> socketWrapper, SocketEvent event, boolean dispatch)Process the given SocketWrapper with the given status.protected voidreleaseSSLContext(SSLHostConfig sslHostConfig)Release the SSLContext, if any, associated with the SSLHostConfig.voidreloadSslHostConfig(java.lang.String hostName)Re-read the configuration files for the SSL host and replace the existing SSL configuration with the updated settings.voidreloadSslHostConfigs()Re-read the configuration files for all SSL hosts and replace the existing SSL configuration with the updated settings.SSLHostConfigremoveSslHostConfig(java.lang.String hostName)Removes the SSL host configuration for the given host name, if such a configuration exists.voidresume()Resume the endpoint, which will make it start accepting new connections again.protected abstract UserverSocketAccept()voidsetAcceptCount(int acceptCount)voidsetAcceptorThreadCount(int acceptorThreadCount)Deprecated.This attribute is hard-coded to1and is no longer configurable.voidsetAcceptorThreadPriority(int acceptorThreadPriority)voidsetAddress(java.net.InetAddress address)voidsetAttribute(java.lang.String name, java.lang.Object value)Generic property setter called when a property for which a specific setter already exists within theProtocolHandlerneeds to be made available to sub-components.voidsetBindOnInit(boolean b)voidsetConnectionLinger(int connectionLinger)voidsetConnectionTimeout(int soTimeout)voidsetDaemon(boolean b)voidsetDefaultSSLHostConfigName(java.lang.String defaultSSLHostConfigName)voidsetDomain(java.lang.String domain)voidsetExecutor(java.util.concurrent.Executor executor)voidsetExecutorTerminationTimeoutMillis(long executorTerminationTimeoutMillis)voidsetHandler(AbstractEndpoint.Handler<S> handler)voidsetKeepAliveTimeout(int keepAliveTimeout)voidsetMaxConnections(int maxCon)voidsetMaxKeepAliveRequests(int maxKeepAliveRequests)voidsetMaxThreads(int maxThreads)voidsetMinSpareThreads(int minSpareThreads)voidsetName(java.lang.String name)voidsetPort(int port)voidsetPortOffset(int portOffset)booleansetProperty(java.lang.String name, java.lang.String value)protected abstract booleansetSocketOptions(U socket)voidsetSSLEnabled(boolean SSLEnabled)voidsetTcpNoDelay(boolean tcpNoDelay)voidsetThreadPriority(int threadPriority)voidsetUseAsyncIO(boolean useAsyncIO)voidsetUseSendfile(boolean useSendfile)voidsetUseVirtualThreads(boolean useVirtualThreads)voidsetUtilityExecutor(java.util.concurrent.ScheduledExecutorService utilityExecutor)voidshutdownExecutor()voidstart()protected voidstartAcceptorThread()abstract voidstartInternal()voidstop()abstract voidstopInternal()static longtoTimeout(long timeout)abstract voidunbind()protected voidunlockAccept()Unlock the server socket acceptor threads using bogus connections.
 
- 
- 
- 
Field Detail- 
smprotected static final StringManager sm 
 - 
runningprotected volatile boolean running Running state of the endpoint.
 - 
pausedprotected volatile boolean paused Will be set to true whenever the endpoint is paused.
 - 
internalExecutorprotected volatile boolean internalExecutor Are we using an internal executor
 - 
socketPropertiesprotected final SocketProperties socketProperties Socket properties
 - 
acceptorprotected Acceptor<U> acceptor Thread used to accept new connections and pass them to worker threads.
 - 
processorCacheprotected SynchronizedStack<SocketProcessorBase<S>> processorCache Cache for SocketProcessor objects
 - 
connectionsprotected java.util.Map<U,SocketWrapperBase<S>> connections Map holding all current connections keyed with the sockets.
 - 
sslHostConfigsprotected java.util.concurrent.ConcurrentMap<java.lang.String,SSLHostConfig> sslHostConfigs 
 - 
acceptorThreadCount@Deprecated protected int acceptorThreadCount Deprecated.This attribute is hard-coded to1and is no longer configurable. It will be removed in Tomcat 10.1.Unused.
 - 
acceptorThreadPriorityprotected int acceptorThreadPriority Priority of the acceptor threads.
 - 
threadPriorityprotected int threadPriority Priority of the worker threads.
 - 
negotiableProtocolsprotected final java.util.List<java.lang.String> negotiableProtocols 
 - 
attributesprotected java.util.HashMap<java.lang.String,java.lang.Object> attributes Attributes provide a way for configuration to be passed to sub-components without theProtocolHandlerbeing aware of the properties available on those sub-components.
 
- 
 - 
Method Detail- 
toTimeoutpublic static long toTimeout(long timeout) 
 - 
getSocketPropertiespublic SocketProperties getSocketProperties() 
 - 
getConnectionspublic java.util.Set<SocketWrapperBase<S>> getConnections() Get a set with the current open connections.- Returns:
- A set with the open socket wrappers
 
 - 
getDefaultSSLHostConfigNamepublic java.lang.String getDefaultSSLHostConfigName() - Returns:
- The host name for the default SSL configuration for this endpoint - always in lower case.
 
 - 
setDefaultSSLHostConfigNamepublic void setDefaultSSLHostConfigName(java.lang.String defaultSSLHostConfigName) 
 - 
addSslHostConfigpublic void addSslHostConfig(SSLHostConfig sslHostConfig) throws java.lang.IllegalArgumentException Add the given SSL Host configuration.- Parameters:
- sslHostConfig- The configuration to add
- Throws:
- java.lang.IllegalArgumentException- If the host name is not valid or if a configuration has already been provided for that host
 
 - 
addSslHostConfigpublic void addSslHostConfig(SSLHostConfig sslHostConfig, boolean replace) throws java.lang.IllegalArgumentException Add the given SSL Host configuration, optionally replacing the existing configuration for the given host.- Parameters:
- sslHostConfig- The configuration to add
- replace- If- truereplacement of an existing configuration is permitted, otherwise any such attempted replacement will trigger an exception
- Throws:
- java.lang.IllegalArgumentException- If the host name is not valid or if a configuration has already been provided for that host and replacement is not allowed
 
 - 
removeSslHostConfigpublic SSLHostConfig removeSslHostConfig(java.lang.String hostName) Removes the SSL host configuration for the given host name, if such a configuration exists.- Parameters:
- hostName- The host name associated with the SSL host configuration to remove
- Returns:
- The SSL host configuration that was removed, if any
 
 - 
reloadSslHostConfigpublic void reloadSslHostConfig(java.lang.String hostName) Re-read the configuration files for the SSL host and replace the existing SSL configuration with the updated settings. Note this replacement will happen even if the settings remain unchanged.- Parameters:
- hostName- The SSL host for which the configuration should be reloaded. This must match a current SSL host
 
 - 
reloadSslHostConfigspublic void reloadSslHostConfigs() Re-read the configuration files for all SSL hosts and replace the existing SSL configuration with the updated settings. Note this replacement will happen even if the settings remain unchanged.
 - 
findSslHostConfigspublic SSLHostConfig[] findSslHostConfigs() 
 - 
createSSLContextprotected abstract void createSSLContext(SSLHostConfig sslHostConfig) throws java.lang.Exception Create the SSLContext for the given SSLHostConfig.- Parameters:
- sslHostConfig- The SSLHostConfig for which the SSLContext should be created
- Throws:
- java.lang.Exception- If the SSLContext cannot be created for the given SSLHostConfig
 
 - 
logCertificateprotected void logCertificate(SSLHostConfigCertificate certificate) 
 - 
generateCertificateDebugprotected java.lang.String generateCertificateDebug(java.security.cert.X509Certificate certificate) 
 - 
destroySslprotected void destroySsl() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
releaseSSLContextprotected void releaseSSLContext(SSLHostConfig sslHostConfig) Release the SSLContext, if any, associated with the SSLHostConfig.- Parameters:
- sslHostConfig- The SSLHostConfig for which the SSLContext should be released
 
 - 
getSSLHostConfigprotected SSLHostConfig getSSLHostConfig(java.lang.String sniHostName) Look up the SSLHostConfig for the given host name. Lookup order is:- exact match
- wild card match
- default SSLHostConfig
 - Parameters:
- sniHostName- Host name - must be in lower case
- Returns:
- The SSLHostConfig for the given host name.
 
 - 
getUseSendfilepublic boolean getUseSendfile() 
 - 
setUseSendfilepublic void setUseSendfile(boolean useSendfile) 
 - 
getExecutorTerminationTimeoutMillispublic long getExecutorTerminationTimeoutMillis() 
 - 
setExecutorTerminationTimeoutMillispublic void setExecutorTerminationTimeoutMillis(long executorTerminationTimeoutMillis) 
 - 
setAcceptorThreadCount@Deprecated public void setAcceptorThreadCount(int acceptorThreadCount) Deprecated.This attribute is hard-coded to1and is no longer configurable. This setter will be removed in Tomcat 10.Unused.- Parameters:
- acceptorThreadCount- Ignored
 
 - 
getAcceptorThreadCount@Deprecated public int getAcceptorThreadCount() Deprecated.This attribute is hard-coded to1and is no longer configurable. This getter will be removed in Tomcat 10.Unused.- Returns:
- Always returns 1
 
 - 
setAcceptorThreadPrioritypublic void setAcceptorThreadPriority(int acceptorThreadPriority) 
 - 
getAcceptorThreadPrioritypublic int getAcceptorThreadPriority() 
 - 
setMaxConnectionspublic void setMaxConnections(int maxCon) 
 - 
getMaxConnectionspublic int getMaxConnections() 
 - 
getConnectionCountpublic long getConnectionCount() Return the current count of connections handled by this endpoint, if the connections are counted (which happens when the maximum count of connections is limited), or-1if they are not. This property is added here so that this value can be inspected through JMX. It is visible on "ThreadPool" MBean.The count is incremented by the Acceptor before it tries to accept a new connection. Until the limit is reached and thus the count cannot be incremented, this value is more by 1 (the count of acceptors) than the actual count of connections that are being served. - Returns:
- The count
 
 - 
setExecutorpublic void setExecutor(java.util.concurrent.Executor executor) 
 - 
getExecutorpublic java.util.concurrent.Executor getExecutor() 
 - 
setUseVirtualThreadspublic void setUseVirtualThreads(boolean useVirtualThreads) 
 - 
getUseVirtualThreadspublic boolean getUseVirtualThreads() 
 - 
setUtilityExecutorpublic void setUtilityExecutor(java.util.concurrent.ScheduledExecutorService utilityExecutor) 
 - 
getUtilityExecutorpublic java.util.concurrent.ScheduledExecutorService getUtilityExecutor() 
 - 
getPortpublic int getPort() 
 - 
setPortpublic void setPort(int port) 
 - 
getPortOffsetpublic int getPortOffset() 
 - 
setPortOffsetpublic void setPortOffset(int portOffset) 
 - 
getPortWithOffsetpublic int getPortWithOffset() 
 - 
getLocalPortpublic final int getLocalPort() 
 - 
getAddresspublic java.net.InetAddress getAddress() 
 - 
setAddresspublic void setAddress(java.net.InetAddress address) 
 - 
getLocalAddressprotected abstract java.net.InetSocketAddress getLocalAddress() throws java.io.IOExceptionObtain 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.- Returns:
- The network address that the server socket is listening on or null if the server socket is not currently bound.
- Throws:
- java.io.IOException- If there is a problem determining the currently bound socket
 
 - 
setAcceptCountpublic void setAcceptCount(int acceptCount) 
 - 
getAcceptCountpublic int getAcceptCount() 
 - 
getBindOnInitpublic boolean getBindOnInit() 
 - 
setBindOnInitpublic void setBindOnInit(boolean b) 
 - 
getBindStateprotected AbstractEndpoint.BindState getBindState() 
 - 
getKeepAliveTimeoutpublic int getKeepAliveTimeout() 
 - 
setKeepAliveTimeoutpublic void setKeepAliveTimeout(int keepAliveTimeout) 
 - 
getTcpNoDelaypublic boolean getTcpNoDelay() Socket TCP no delay.- Returns:
- The current TCP no delay setting for sockets created by this endpoint
 
 - 
setTcpNoDelaypublic void setTcpNoDelay(boolean tcpNoDelay) 
 - 
getConnectionLingerpublic int getConnectionLinger() Socket linger.- Returns:
- The current socket linger time for sockets created by this endpoint
 
 - 
setConnectionLingerpublic void setConnectionLinger(int connectionLinger) 
 - 
getConnectionTimeoutpublic int getConnectionTimeout() Socket timeout.- Returns:
- The current socket timeout for sockets created by this endpoint
 
 - 
setConnectionTimeoutpublic void setConnectionTimeout(int soTimeout) 
 - 
isSSLEnabledpublic boolean isSSLEnabled() 
 - 
setSSLEnabledpublic void setSSLEnabled(boolean SSLEnabled) 
 - 
isAlpnSupportedpublic abstract boolean isAlpnSupported() Identifies if the endpoint supports ALPN. Note that a return value oftrueimplies thatisSSLEnabled()will also returntrue.- Returns:
- trueif the endpoint supports ALPN in its current configuration, otherwise- false.
 
 - 
setMinSpareThreadspublic void setMinSpareThreads(int minSpareThreads) 
 - 
getMinSpareThreadspublic int getMinSpareThreads() 
 - 
setMaxThreadspublic void setMaxThreads(int maxThreads) 
 - 
getMaxThreadspublic int getMaxThreads() 
 - 
setThreadPrioritypublic void setThreadPriority(int threadPriority) 
 - 
getThreadPrioritypublic int getThreadPriority() 
 - 
getMaxKeepAliveRequestspublic int getMaxKeepAliveRequests() 
 - 
setMaxKeepAliveRequestspublic void setMaxKeepAliveRequests(int maxKeepAliveRequests) 
 - 
setNamepublic void setName(java.lang.String name) 
 - 
getNamepublic java.lang.String getName() 
 - 
setDomainpublic void setDomain(java.lang.String domain) 
 - 
getDomainpublic java.lang.String getDomain() 
 - 
setDaemonpublic void setDaemon(boolean b) 
 - 
getDaemonpublic boolean getDaemon() 
 - 
setUseAsyncIOpublic void setUseAsyncIO(boolean useAsyncIO) 
 - 
getUseAsyncIOpublic boolean getUseAsyncIO() 
 - 
getDeferAcceptprotected abstract boolean getDeferAccept() 
 - 
getIdpublic java.lang.String getId() 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.- Returns:
- the id
 
 - 
addNegotiatedProtocolpublic void addNegotiatedProtocol(java.lang.String negotiableProtocol) 
 - 
hasNegotiableProtocolspublic boolean hasNegotiableProtocols() 
 - 
setHandlerpublic void setHandler(AbstractEndpoint.Handler<S> handler) 
 - 
getHandlerpublic AbstractEndpoint.Handler<S> getHandler() 
 - 
setAttributepublic void setAttribute(java.lang.String name, java.lang.Object value)Generic property setter called when a property for which a specific setter already exists within theProtocolHandlerneeds to be made available to sub-components. The specific setter will call this method to populate the attributes.- Parameters:
- name- Name of property to set
- value- The value to set the property to
 
 - 
getAttributepublic java.lang.Object getAttribute(java.lang.String key) Used by sub-components to retrieve configuration information.- Parameters:
- key- The name of the property for which the value should be retrieved
- Returns:
- The value of the specified property
 
 - 
setPropertypublic boolean setProperty(java.lang.String name, java.lang.String value)
 - 
getPropertypublic java.lang.String getProperty(java.lang.String name) 
 - 
getCurrentThreadCountpublic int getCurrentThreadCount() Return the amount of threads that are managed by the pool.- Returns:
- the amount of threads that are managed by the pool
 
 - 
getCurrentThreadsBusypublic int getCurrentThreadsBusy() Return the amount of threads that are in use- Returns:
- the amount of threads that are in use
 
 - 
isRunningpublic boolean isRunning() 
 - 
isPausedpublic boolean isPaused() 
 - 
createExecutorpublic void createExecutor() 
 - 
shutdownExecutorpublic void shutdownExecutor() 
 - 
unlockAcceptprotected void unlockAccept() Unlock the server socket acceptor threads using bogus connections.
 - 
processSocketpublic boolean processSocket(SocketWrapperBase<S> socketWrapper, SocketEvent event, boolean dispatch) Process the given SocketWrapper with the given status. Used to trigger processing as if the Poller (for those endpoints that have one) selected the socket.- Parameters:
- socketWrapper- The socket wrapper to process
- event- The socket event to be processed
- dispatch- Should the processing be performed on a new container thread
- Returns:
- if processing was triggered successfully
 
 - 
createSocketProcessorprotected abstract SocketProcessorBase<S> createSocketProcessor(SocketWrapperBase<S> socketWrapper, SocketEvent event) 
 - 
bindpublic abstract void bind() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
unbindpublic abstract void unbind() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
startInternalpublic abstract void startInternal() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
stopInternalpublic abstract void stopInternal() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
initpublic final void init() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
startpublic final void start() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
startAcceptorThreadprotected void startAcceptorThread() 
 - 
pausepublic void pause() Pause the endpoint, which will stop it accepting new connections and unlock the acceptor.
 - 
resumepublic void resume() Resume the endpoint, which will make it start accepting new connections again.
 - 
stoppublic final void stop() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
destroypublic final void destroy() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
getLogprotected abstract Log getLog() 
 - 
getLogCertificateprotected Log getLogCertificate() 
 - 
initializeConnectionLatchprotected LimitLatch initializeConnectionLatch() 
 - 
countUpOrAwaitConnectionprotected void countUpOrAwaitConnection() throws java.lang.InterruptedException- Throws:
- java.lang.InterruptedException
 
 - 
countDownConnectionprotected long countDownConnection() 
 - 
closeServerSocketGracefulpublic final void closeServerSocketGraceful() Close the server socket (to prevent further connections) if the server socket was originally bound onstart()(rather than oninit()).- See Also:
- getBindOnInit()
 
 - 
awaitConnectionsClosepublic final long awaitConnectionsClose(long waitMillis) Wait for the client connections to the server to close gracefully. The method will return when all of the client connections have closed or the method has been waiting forwaitTimeMillis.- Parameters:
- waitMillis- The maximum time to wait in milliseconds for the client connections to close.
- Returns:
- The wait time, if any remaining when the method returned
 
 - 
doCloseServerSocketprotected abstract void doCloseServerSocket() throws java.io.IOExceptionActually close the server socket but don't perform any other clean-up.- Throws:
- java.io.IOException- If an error occurs closing the socket
 
 - 
serverSocketAcceptprotected abstract U serverSocketAccept() throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
setSocketOptionsprotected abstract boolean setSocketOptions(U socket) 
 - 
closeSocketprotected void closeSocket(U socket) Close the socket when the connection has to be immediately closed when an error occurs while configuring the accepted socket or trying to dispatch it for processing. The wrapper associated with the socket will be used for the close.- Parameters:
- socket- The newly accepted socket
 
 - 
destroySocketprotected abstract void destroySocket(U socket) 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.- Parameters:
- socket- The newly accepted socket
 
 
- 
 
-