Package com.google.code.yanf4j.nio.impl
Class SocketChannelController
java.lang.Object
com.google.code.yanf4j.core.impl.AbstractController
com.google.code.yanf4j.nio.impl.NioController
com.google.code.yanf4j.nio.impl.SocketChannelController
- All Implemented Interfaces:
Controller
,ControllerLifeCycle
,SelectionKeyHandler
- Direct Known Subclasses:
MemcachedConnector
,TCPController
Nio tcp socket controller
-
Field Summary
FieldsFields inherited from class com.google.code.yanf4j.nio.impl.NioController
selectorManager, selectorPoolSize
Fields inherited from class com.google.code.yanf4j.core.impl.AbstractController
codecFactory, configuration, dispatchMessageDispatcher, dispatchMessageThreadCount, handler, handleReadWriteConcurrently, localSocketAddress, log, readEventDispatcher, readThreadCount, sessionSet, sessionTimeout, socketOptions, soTimeout, started, stateListeners, statistics, statisticsInterval, writeEventDispatcher, writeThreadCount
-
Constructor Summary
ConstructorsConstructorDescriptionSocketChannelController
(Configuration configuration) SocketChannelController
(Configuration configuration, CodecFactory codecFactory) SocketChannelController
(Configuration configuration, Handler handler, CodecFactory codecFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected NioSession
protected final void
Confiure socket channelprotected final void
Dispatch read eventprotected final void
Dispatch write eventvoid
setSoLinger
(boolean on, int value) Methods inherited from class com.google.code.yanf4j.nio.impl.NioController
bind, buildSessionConfig, closeSelectionKey, doStart, getSelectorManager, getSelectorPoolSize, initialSelectorManager, onRead, onWrite, setSelectorPoolSize, start0, stop0
Methods inherited from class com.google.code.yanf4j.core.impl.AbstractController
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, unregisterSession
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.code.yanf4j.nio.SelectionKeyHandler
closeChannel, onAccept, onConnect
-
Field Details
-
soLingerOn
protected boolean soLingerOn
-
-
Constructor Details
-
SocketChannelController
public SocketChannelController() -
SocketChannelController
-
SocketChannelController
-
SocketChannelController
public SocketChannelController(Configuration configuration, Handler handler, CodecFactory codecFactory)
-
-
Method Details
-
setSoLinger
public void setSoLinger(boolean on, int value) -
dispatchReadEvent
Description copied from class:NioController
Dispatch read event- Specified by:
dispatchReadEvent
in classNioController
- Parameters:
key
-
-
dispatchWriteEvent
Description copied from class:NioController
Dispatch write event- Specified by:
dispatchWriteEvent
in classNioController
- Parameters:
key
-
-
buildSession
-
configureSocketChannel
Confiure socket channel- Parameters:
sc
-- Throws:
IOException
-