Class Nio2Endpoint
java.lang.Object
org.apache.tomcat.util.net.AbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
org.apache.tomcat.util.net.AbstractJsseEndpoint<Nio2Channel,AsynchronousSocketChannel>
org.apache.tomcat.util.net.Nio2Endpoint
NIO2 endpoint.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classstatic classstatic classSendfileData class.protected classThis class is the equivalent of the Worker, but will simply use in an external Executor thread pool.Nested classes/interfaces inherited from class org.apache.tomcat.util.net.AbstractEndpoint
AbstractEndpoint.BindState, AbstractEndpoint.Handler<S> -
Field Summary
Fields inherited from class org.apache.tomcat.util.net.AbstractEndpoint
acceptor, acceptorThreadCount, acceptorThreadPriority, attributes, connections, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbind()Initialize the endpoint.protected SocketProcessorBase<Nio2Channel> createSocketProcessor(SocketWrapperBase<Nio2Channel> socketWrapper, SocketEvent event) protected voidClose the socket.protected voidActually close the server socket but don't perform any other clean-up.static voidbooleanIs deferAccept supported?intNumber of keep-alive sockets.protected LoggetLog()protected Logprotected SynchronizedStack<Nio2Channel> protected NetworkChannelstatic booleanisInline()voidresume()Resume the endpoint, which will make it start accepting new connections again.protected AsynchronousSocketChannelprotected booleanProcess the specified connection.voidprotected voidstatic voidvoidStart the NIO2 endpoint, creating acceptor.voidStop the endpoint.voidunbind()Deallocate NIO memory pools, and close server socket.Methods inherited from class org.apache.tomcat.util.net.AbstractJsseEndpoint
createSSLContext, createSSLEngine, getLocalAddress, getSniParseLimit, getSslImplementation, getSslImplementationName, initialiseSsl, isAlpnSupported, setDefaultSslHostConfig, setSniParseLimit, setSslImplementationNameMethods inherited from class org.apache.tomcat.util.net.AbstractEndpoint
addNegotiatedProtocol, addSslHostConfig, addSslHostConfig, awaitConnectionsClose, closeServerSocketGraceful, closeSocket, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, destroySsl, findSslHostConfigs, generateCertificateDebug, getAcceptCount, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAttribute, getBindOnInit, getBindState, getConnectionCount, getConnectionLinger, getConnections, getConnectionTimeout, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getDomain, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getId, getKeepAliveTimeout, getLocalPort, getMaxConnections, getMaxKeepAliveRequests, getMaxQueueSize, getMaxThreads, getMinSpareThreads, getName, getPort, getPortOffset, getPortWithOffset, getProperty, getSocketProperties, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getThreadsMaxIdleTime, getUseAsyncIO, getUseSendfile, getUseVirtualThreads, getUtilityExecutor, hasNegotiableProtocols, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, logCertificate, pause, processSocket, releaseSSLContext, reloadSslHostConfig, reloadSslHostConfigs, removeSslHostConfig, setAcceptCount, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAttribute, setBindOnInit, setConnectionLinger, setConnectionTimeout, setDaemon, setDefaultSSLHostConfigName, setDomain, setExecutor, setExecutorTerminationTimeoutMillis, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxKeepAliveRequests, setMaxQueueSize, setMaxThreads, setMinSpareThreads, setName, setPort, setPortOffset, setProperty, setSSLEnabled, setTcpNoDelay, setThreadPriority, setThreadsMaxIdleTime, setUseAsyncIO, setUseSendfile, setUseVirtualThreads, setUtilityExecutor, start, stop, toTimeout, unlockAccept
-
Constructor Details
-
Nio2Endpoint
public Nio2Endpoint()
-
-
Method Details
-
getDeferAccept
public boolean getDeferAccept()Is deferAccept supported?- Specified by:
getDeferAcceptin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
getKeepAliveCount
public int getKeepAliveCount()Number of keep-alive sockets.- Returns:
- Always returns -1.
-
bind
Initialize the endpoint.- Specified by:
bindin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> - Throws:
Exception
-
startInternal
Start the NIO2 endpoint, creating acceptor.- Specified by:
startInternalin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> - Throws:
Exception
-
startAcceptorThread
protected void startAcceptorThread()- Overrides:
startAcceptorThreadin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
resume
public void resume()Description copied from class:AbstractEndpointResume the endpoint, which will make it start accepting new connections again.- Overrides:
resumein classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
stopInternal
public void stopInternal()Stop the endpoint. This will cause all processing threads to stop.- Specified by:
stopInternalin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
unbind
Deallocate NIO memory pools, and close server socket.- Overrides:
unbindin classAbstractJsseEndpoint<Nio2Channel,AsynchronousSocketChannel> - Throws:
Exception
-
doCloseServerSocket
Description copied from class:AbstractEndpointActually close the server socket but don't perform any other clean-up.- Specified by:
doCloseServerSocketin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> - Throws:
IOException- If an error occurs closing the socket
-
shutdownExecutor
public void shutdownExecutor()- Overrides:
shutdownExecutorin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
setSocketOptions
Process the specified connection.- Specified by:
setSocketOptionsin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> - Parameters:
socket- The socket channel- Returns:
trueif the socket was correctly configured and processing may continue,falseif the socket needs to be close immediately
-
destroySocket
Description copied from class:AbstractEndpointClose 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:
destroySocketin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> - Parameters:
socket- The newly accepted socket
-
getNioChannels
-
getServerSocket
- Specified by:
getServerSocketin classAbstractJsseEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
serverSocketAccept
- Specified by:
serverSocketAcceptin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel> - Throws:
Exception
-
getLog
- Specified by:
getLogin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
getLogCertificate
- Overrides:
getLogCertificatein classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
createSocketProcessor
protected SocketProcessorBase<Nio2Channel> createSocketProcessor(SocketWrapperBase<Nio2Channel> socketWrapper, SocketEvent event) - Specified by:
createSocketProcessorin classAbstractEndpoint<Nio2Channel,AsynchronousSocketChannel>
-
startInline
public static void startInline() -
endInline
public static void endInline() -
isInline
public static boolean isInline()
-