S - type of AbstractNioServer which extends from itpublic abstract class AbstractServer<S extends AbstractServer<S>> extends Object implements EventloopServer, WorkerServer, Initializable<S>, EventloopJmxMBeanEx
EventloopServer. It is non-blocking server which works in eventloop.
The server runs on the one thread, and all events are fired on that thread. This server can listen few
addresses in one time and you can register multiple connections for responding to incoming data.| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractServer.AcceptFilter |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
acceptOnce |
static ServerSocketSettings |
DEFAULT_SERVER_SOCKET_SETTINGS |
static SocketSettings |
DEFAULT_SOCKET_SETTINGS |
protected Eventloop |
eventloop |
protected List<InetSocketAddress> |
listenAddresses |
protected org.slf4j.Logger |
logger |
protected ServerSocketSettings |
serverSocketSettings |
protected SocketSettings |
socketSettings |
protected List<InetSocketAddress> |
sslListenAddresses |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractServer(Eventloop eventloop) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinitialize, initializegetSmoothingWindow, resetStats, setSmoothingWindowprotected org.slf4j.Logger logger
protected final Eventloop eventloop
public static final ServerSocketSettings DEFAULT_SERVER_SOCKET_SETTINGS
public static final SocketSettings DEFAULT_SOCKET_SETTINGS
protected ServerSocketSettings serverSocketSettings
protected SocketSettings socketSettings
protected boolean acceptOnce
protected List<InetSocketAddress> listenAddresses
protected List<InetSocketAddress> sslListenAddresses
protected AbstractServer(Eventloop eventloop)
public final S withAcceptFilter(AbstractServer.AcceptFilter acceptFilter)
public final S withServerSocketSettings(ServerSocketSettings serverSocketSettings)
public final S withSocketSettings(SocketSettings socketSettings)
public final S withListenAddresses(List<InetSocketAddress> addresses)
public final S withListenAddresses(InetSocketAddress... addresses)
public final S withListenAddress(InetSocketAddress address)
public final S withListenPort(int port)
public final S withSslListenAddresses(SSLContext sslContext, ExecutorService sslExecutor, List<InetSocketAddress> addresses)
public final S withSslListenAddresses(SSLContext sslContext, ExecutorService sslExecutor, InetSocketAddress... addresses)
public final S withSslListenAddress(SSLContext sslContext, ExecutorService sslExecutor, InetSocketAddress address)
public final S withSslListenPort(SSLContext sslContext, ExecutorService sslExecutor, int port)
public final S withAcceptOnce()
public final S withAcceptOnce(boolean acceptOnce)
public final S withLogger(org.slf4j.Logger logger)
public ServerSocketSettings getServerSocketSettings()
public SocketSettings getSocketSettings()
public final Eventloop getEventloop()
getEventloop in interface EventloopServergetEventloop in interface WorkerServergetEventloop in interface EventloopJmxMBeanpublic final void listen()
throws IOException
EventloopServerlisten in interface EventloopServerIOException - if the socket can not be created.protected void onListen()
public final Stage<Void> close()
EventloopServerclose in interface EventloopServerpublic final Future<?> closeFuture()
protected void onClose(SettableStage<Void> stage)
public boolean isRunning()
protected WorkerServer getWorkerServer()
protected AsyncTcpSocketImpl.Inspector getSocketInspector(InetAddress remoteAddress, InetSocketAddress localAddress, boolean ssl)
protected void onAccept(SocketChannel socketChannel, InetSocketAddress localAddress, InetAddress remoteAddress, boolean ssl)
protected void onFilteredAccept(SocketChannel socketChannel, InetSocketAddress localAddress, InetAddress remoteAddress, boolean ssl)
public void doAccept(SocketChannel socketChannel, InetSocketAddress localAddress, InetAddress remoteAddress, boolean ssl, SocketSettings socketSettings)
doAccept in interface WorkerServerprotected abstract AsyncTcpSocket.EventHandler createSocketHandler(AsyncTcpSocket asyncTcpSocket)
@Nullable public final EventStats getAccepts()
@Nullable public EventStats getAcceptsSsl()
@Nullable public EventStats getFilteredAccepts()
@Nullable public AsyncTcpSocketImpl.JmxInspector getSocketStats()
@Nullable public AsyncTcpSocketImpl.JmxInspector getSocketStatsSsl()
Copyright © 2019. All rights reserved.