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
public abstract class SocketChannelController extends NioController
Nio tcp socket controller
-
-
Field Summary
Fields Modifier and Type Field Description protected booleansoLingerOn-
Fields 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
Constructors Constructor Description SocketChannelController()SocketChannelController(Configuration configuration)SocketChannelController(Configuration configuration, CodecFactory codecFactory)SocketChannelController(Configuration configuration, Handler handler, CodecFactory codecFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NioSessionbuildSession(java.nio.channels.SocketChannel sc)protected voidconfigureSocketChannel(java.nio.channels.SocketChannel sc)Confiure socket channelprotected voiddispatchReadEvent(java.nio.channels.SelectionKey key)Dispatch read eventprotected voiddispatchWriteEvent(java.nio.channels.SelectionKey key)Dispatch write eventvoidsetSoLinger(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
-
-
-
-
Constructor Detail
-
SocketChannelController
public SocketChannelController()
-
SocketChannelController
public SocketChannelController(Configuration configuration)
-
SocketChannelController
public SocketChannelController(Configuration configuration, CodecFactory codecFactory)
-
SocketChannelController
public SocketChannelController(Configuration configuration, Handler handler, CodecFactory codecFactory)
-
-
Method Detail
-
setSoLinger
public void setSoLinger(boolean on, int value)
-
dispatchReadEvent
protected final void dispatchReadEvent(java.nio.channels.SelectionKey key)
Description copied from class:NioControllerDispatch read event- Specified by:
dispatchReadEventin classNioController
-
dispatchWriteEvent
protected final void dispatchWriteEvent(java.nio.channels.SelectionKey key)
Description copied from class:NioControllerDispatch write event- Specified by:
dispatchWriteEventin classNioController
-
buildSession
protected NioSession buildSession(java.nio.channels.SocketChannel sc)
-
configureSocketChannel
protected final void configureSocketChannel(java.nio.channels.SocketChannel sc) throws java.io.IOExceptionConfiure socket channel- Parameters:
sc-- Throws:
java.io.IOException
-
-