public abstract class NioController extends AbstractController implements SelectionKeyHandler
| Modifier and Type | Field and Description |
|---|---|
protected SelectorManager |
selectorManager |
protected int |
selectorPoolSize
Reactor count
|
codecFactory, configuration, dispatchMessageDispatcher, dispatchMessageThreadCount, handler, handleReadWriteConcurrently, localSocketAddress, log, readEventDispatcher, readThreadCount, sessionSet, sessionTimeout, socketOptions, soTimeout, started, stateListeners, statistics, statisticsInterval, writeEventDispatcher, writeThreadCount| Constructor and Description |
|---|
NioController() |
NioController(Configuration configuration) |
NioController(Configuration configuration,
CodecFactory codecFactory) |
NioController(Configuration configuration,
Handler handler,
CodecFactory codecFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(int port) |
protected NioSessionConfig |
buildSessionConfig(SelectableChannel sc,
Queue<WriteMessage> queue)
Build nio session config
|
void |
closeSelectionKey(SelectionKey key)
Cancel selection key
|
protected abstract void |
dispatchReadEvent(SelectionKey key)
Dispatch read event
|
protected abstract void |
dispatchWriteEvent(SelectionKey key)
Dispatch write event
|
protected abstract void |
doStart()
Inner startup
|
SelectorManager |
getSelectorManager() |
int |
getSelectorPoolSize() |
protected void |
initialSelectorManager()
Start selector manager
|
void |
onRead(SelectionKey key)
Read event occured
|
void |
onWrite(SelectionKey key)
Writable event occured
|
void |
setSelectorPoolSize(int selectorPoolSize) |
protected void |
start0() |
protected void |
stop0() |
addStateListener, bind, buildQueue, checkStatisticsForRestart, getCodecFactory, getConfiguration, getDispatchMessageThreadCount, getHandler, getLocalSocketAddress, getPort, getReadThreadCount, getReceiveThroughputLimit, getSendThroughputLimit, getSessionIdleTimeout, getSessionSet, getSessionTimeout, getSocketOption, getSoTimeout, getStatistics, getWriteThreadCount, isHandleReadWriteConcurrently, isStarted, notifyAllSessionClosed, notifyException, notifyReady, notifyStarted, notifyStopped, onAccept, onConnect, registerSession, removeStateListener, setCodecFactory, setConfiguration, setDispatchMessageThreadCount, setHandler, setHandleReadWriteConcurrently, setLocalSocketAddress, setReadThreadCount, setReceiveThroughputLimit, setSendThroughputLimit, setSessionIdleTimeout, setSessionTimeout, setSocketOption, setSocketOptions, setSoTimeout, setWriteThreadCount, start, stop, unregisterSessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseChannel, onAccept, onConnectprotected SelectorManager selectorManager
protected int selectorPoolSize
public NioController()
public NioController(Configuration configuration, CodecFactory codecFactory)
public NioController(Configuration configuration, Handler handler, CodecFactory codecFactory)
public NioController(Configuration configuration)
public int getSelectorPoolSize()
setSelectorPoolSizepublic void setSelectorPoolSize(int selectorPoolSize)
public final SelectorManager getSelectorManager()
protected void start0()
throws IOException
start0 in class AbstractControllerIOExceptionprotected void initialSelectorManager()
throws IOException
IOExceptionprotected abstract void doStart()
throws IOException
IOExceptionpublic void onRead(SelectionKey key)
onRead in interface SelectionKeyHandlerpublic void onWrite(SelectionKey key)
onWrite in interface SelectionKeyHandlerpublic void closeSelectionKey(SelectionKey key)
closeSelectionKey in interface SelectionKeyHandlerprotected abstract void dispatchReadEvent(SelectionKey key)
key - protected abstract void dispatchWriteEvent(SelectionKey key)
key - protected void stop0()
throws IOException
stop0 in class AbstractControllerIOExceptionpublic void bind(int port)
throws IOException
IOExceptionprotected final NioSessionConfig buildSessionConfig(SelectableChannel sc, Queue<WriteMessage> queue)
sc - queue - Copyright © 2016. All rights reserved.