public abstract class NioController extends AbstractController implements SelectionKeyHandler
| 限定符和类型 | 字段和说明 |
|---|---|
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| 构造器和说明 |
|---|
NioController() |
NioController(Configuration configuration) |
NioController(Configuration configuration,
CodecFactory codecFactory) |
NioController(Configuration configuration,
Handler handler,
CodecFactory codecFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在类中 AbstractControllerIOExceptionprotected void initialSelectorManager()
throws IOException
IOExceptionprotected abstract void doStart()
throws IOException
IOExceptionpublic void onRead(SelectionKey key)
onRead 在接口中 SelectionKeyHandlerpublic void onWrite(SelectionKey key)
onWrite 在接口中 SelectionKeyHandlerpublic void closeSelectionKey(SelectionKey key)
closeSelectionKey 在接口中 SelectionKeyHandlerprotected abstract void dispatchReadEvent(SelectionKey key)
key - protected abstract void dispatchWriteEvent(SelectionKey key)
key - protected void stop0()
throws IOException
stop0 在类中 AbstractControllerIOExceptionpublic void bind(int port)
throws IOException
IOExceptionprotected final NioSessionConfig buildSessionConfig(SelectableChannel sc, Queue<WriteMessage> queue)
sc - queue - Copyright © 2013. All Rights Reserved.