Todo
Consider using the virtual machine's thread pool.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public class | NioEndpoint.
Poller class. |
| public static class | NioEndpoint.
PollerEvent, cacheable object for poller events to avoid GC |
| public static class | NioEndpoint.
SendfileData class. |
| protected class | NioEndpoint.
This class is the equivalent of the Worker, but will simply use in an external Executor thread pool. |
| Modifier and Type | Field and Description |
|---|---|
| private SynchronizedStack | eventCache
Cache for poller events |
| private static final Log | |
| private static final Log | |
| private static final Log | |
| private SynchronizedStack | nioChannels
Bytebuffer cache, each channel holds a set of buffers (two, except for SSL holds four) |
| public static final int | |
| private NioEndpoint. | poller
The socket poller. |
| private int | pollerThreadPriority
Priority of the poller thread. |
| private long | |
| private SocketAddress | |
| private long | |
| private volatile ServerSocketChannel | serverSock
Server socket "pointer". |
| private volatile CountDownLatch | stopLatch
Stop latch used to wait for poller stop |
| private String | unixDomainSocketPath
Path for the Unix domain socket, used to create the socket address. |
| private String | unixDomainSocketPathPermissions
Permissions which will be set on the Unix domain socket if it is created. |
| private boolean | useInheritedChannel
Use System.inheritableChannel to obtain channel from stdin/stdout. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | bind()
Implements abstract org. Initialize the endpoint. |
| protected SocketProcessorBase | createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper, SocketEvent event)
Implements abstract org.
|
| protected void | destroySocket(SocketChannel
The newly accepted socket socket)Implements abstract org. Close the socket. |
| protected void | doCloseServerSocket()
Implements abstract org. Actually close the server socket but don't perform any other clean-up. |
| public String | getId()
Overrides org. The default behavior is to identify connectors uniquely with address and port. |
| public int | Returns: The number of sockets currently in the keep-alive state waiting for the next request to be received on the socketNumber of keep-alive sockets. |
| protected Log | |
| protected Log | |
| protected SynchronizedStack | |
| protected NioEndpoint. | |
| public int | |
| public long | |
| protected NetworkChannel | getServerSocket()
Implements abstract org.
|
| protected CountDownLatch | |
| public String | |
| public String | |
| public boolean | |
| protected void | |
| protected SocketChannel | serverSocketAccept()
Implements abstract org.
|
| public void | |
| public void | |
| protected boolean | Returns: true if the socket was correctly configured
and processing may continue, false if the socket needs to be
close immediatelyThe socket channel socket)Implements abstract org. Process the specified connection. |
| protected void | |
| public void | |
| public void | |
| public void | |
| public void | startInternal()
Implements abstract org. Start the NIO endpoint, creating acceptor, poller threads. |
| public void | stopInternal()
Implements abstract org. Stop the endpoint. |
| public void | unbind()
Overrides org. Deallocate NIO memory pools, and close server socket. |
| protected void | unlockAccept()
Overrides org. Unlock the server socket acceptor threads using bogus connections. |