public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel>
Modifier and Type | Class and Description |
---|---|
static class |
NioEndpoint.NioSocketWrapper |
class |
NioEndpoint.Poller
Poller class.
|
static class |
NioEndpoint.PollerEvent
PollerEvent, cacheable object for poller events to avoid GC
|
static class |
NioEndpoint.SendfileData
SendfileData class.
|
protected class |
NioEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
AbstractEndpoint.BindState, AbstractEndpoint.Handler<S>
Modifier and Type | Field and Description |
---|---|
static int |
OP_REGISTER |
acceptor, acceptorThreadCount, acceptorThreadPriority, attributes, connections, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority
Constructor and Description |
---|
NioEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
bind()
Initialize the endpoint.
|
protected SocketProcessorBase<NioChannel> |
createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper,
SocketEvent event) |
protected void |
destroySocket(SocketChannel socket)
Close the socket.
|
protected void |
doCloseServerSocket()
Actually close the server socket but don't perform any other clean-up.
|
boolean |
getDeferAccept()
Is deferAccept supported?
|
String |
getId()
The default behavior is to identify connectors uniquely with address
and port.
|
int |
getKeepAliveCount()
Number of keep-alive sockets.
|
protected Log |
getLog() |
protected SynchronizedStack<NioChannel> |
getNioChannels() |
protected NioEndpoint.Poller |
getPoller() |
int |
getPollerThreadCount()
Deprecated.
Will be removed in Tomcat 10.
|
int |
getPollerThreadPriority() |
long |
getSelectorTimeout() |
protected NetworkChannel |
getServerSocket() |
protected CountDownLatch |
getStopLatch() |
String |
getUnixDomainSocketPath() |
String |
getUnixDomainSocketPathPermissions() |
boolean |
getUseInheritedChannel() |
protected void |
initServerSocket() |
protected SocketChannel |
serverSocketAccept() |
void |
setPollerThreadCount(int pollerThreadCount)
Deprecated.
Will be removed in Tomcat 10.
|
void |
setPollerThreadPriority(int pollerThreadPriority) |
void |
setSelectorTimeout(long timeout) |
protected boolean |
setSocketOptions(SocketChannel socket)
Process the specified connection.
|
protected void |
setStopLatch(CountDownLatch stopLatch) |
void |
setUnixDomainSocketPath(String unixDomainSocketPath) |
void |
setUnixDomainSocketPathPermissions(String unixDomainSocketPathPermissions) |
void |
setUseInheritedChannel(boolean useInheritedChannel) |
void |
startInternal()
Start the NIO endpoint, creating acceptor, poller threads.
|
void |
stopInternal()
Stop the endpoint.
|
void |
unbind()
Deallocate NIO memory pools, and close server socket.
|
protected void |
unlockAccept()
Unlock the server socket acceptor threads using bogus connections.
|
createSSLContext, createSSLEngine, getLocalAddress, getSniParseLimit, getSslImplementation, getSslImplementationName, initialiseSsl, isAlpnSupported, setSniParseLimit, setSslImplementationName
addNegotiatedProtocol, addSslHostConfig, addSslHostConfig, awaitConnectionsClose, closeServerSocketGraceful, closeSocket, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, destroySsl, findSslHostConfigs, getAcceptCount, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAttribute, getBindOnInit, getBindState, getConnectionCount, getConnectionLinger, getConnections, getConnectionTimeout, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getDomain, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getKeepAliveTimeout, getLocalPort, getMaxConnections, getMaxKeepAliveRequests, getMaxThreads, getMinSpareThreads, getName, getPort, getPortOffset, getPortWithOffset, getProperty, getSocketProperties, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getUseAsyncIO, getUseSendfile, getUtilityExecutor, hasNegotiableProtocols, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, processSocket, releaseSSLContext, reloadSslHostConfig, reloadSslHostConfigs, removeSslHostConfig, resume, setAcceptCount, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAttribute, setBindOnInit, setConnectionLinger, setConnectionTimeout, setDaemon, setDefaultSSLHostConfigName, setDomain, setExecutor, setExecutorTerminationTimeoutMillis, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setPortOffset, setProperty, setSSLEnabled, setTcpNoDelay, setThreadPriority, setUseAsyncIO, setUseSendfile, setUtilityExecutor, shutdownExecutor, start, startAcceptorThread, stop, toTimeout
public static final int OP_REGISTER
public void setUseInheritedChannel(boolean useInheritedChannel)
public boolean getUseInheritedChannel()
public String getUnixDomainSocketPath()
public void setUnixDomainSocketPath(String unixDomainSocketPath)
public String getUnixDomainSocketPathPermissions()
public void setUnixDomainSocketPathPermissions(String unixDomainSocketPathPermissions)
public void setPollerThreadPriority(int pollerThreadPriority)
public int getPollerThreadPriority()
@Deprecated public void setPollerThreadCount(int pollerThreadCount)
pollerThreadCount
- Unused@Deprecated public int getPollerThreadCount()
public void setSelectorTimeout(long timeout)
public long getSelectorTimeout()
public boolean getDeferAccept()
getDeferAccept
in class AbstractEndpoint<NioChannel,SocketChannel>
public int getKeepAliveCount()
public String getId()
AbstractEndpoint
getId
in class AbstractEndpoint<NioChannel,SocketChannel>
public void bind() throws Exception
bind
in class AbstractEndpoint<NioChannel,SocketChannel>
Exception
public void startInternal() throws Exception
startInternal
in class AbstractEndpoint<NioChannel,SocketChannel>
Exception
public void stopInternal()
stopInternal
in class AbstractEndpoint<NioChannel,SocketChannel>
public void unbind() throws Exception
unbind
in class AbstractJsseEndpoint<NioChannel,SocketChannel>
Exception
protected void doCloseServerSocket() throws IOException
AbstractEndpoint
doCloseServerSocket
in class AbstractEndpoint<NioChannel,SocketChannel>
IOException
- If an error occurs closing the socketprotected void unlockAccept()
AbstractEndpoint
unlockAccept
in class AbstractEndpoint<NioChannel,SocketChannel>
protected SynchronizedStack<NioChannel> getNioChannels()
protected NioEndpoint.Poller getPoller()
protected CountDownLatch getStopLatch()
protected void setStopLatch(CountDownLatch stopLatch)
protected boolean setSocketOptions(SocketChannel socket)
setSocketOptions
in class AbstractEndpoint<NioChannel,SocketChannel>
socket
- The socket channeltrue
if the socket was correctly configured
and processing may continue, false
if the socket needs to be
close immediatelyprotected void destroySocket(SocketChannel socket)
AbstractEndpoint
destroySocket
in class AbstractEndpoint<NioChannel,SocketChannel>
socket
- The newly accepted socketprotected NetworkChannel getServerSocket()
getServerSocket
in class AbstractJsseEndpoint<NioChannel,SocketChannel>
protected SocketChannel serverSocketAccept() throws Exception
serverSocketAccept
in class AbstractEndpoint<NioChannel,SocketChannel>
Exception
protected Log getLog()
getLog
in class AbstractEndpoint<NioChannel,SocketChannel>
protected SocketProcessorBase<NioChannel> createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper, SocketEvent event)
createSocketProcessor
in class AbstractEndpoint<NioChannel,SocketChannel>
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.