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 boolean
soLingerOn
-
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 NioSession
buildSession(java.nio.channels.SocketChannel sc)
protected void
configureSocketChannel(java.nio.channels.SocketChannel sc)
Confiure socket channelprotected void
dispatchReadEvent(java.nio.channels.SelectionKey key)
Dispatch read eventprotected void
dispatchWriteEvent(java.nio.channels.SelectionKey key)
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
-
-
-
-
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:NioController
Dispatch read event- Specified by:
dispatchReadEvent
in classNioController
-
dispatchWriteEvent
protected final void dispatchWriteEvent(java.nio.channels.SelectionKey key)
Description copied from class:NioController
Dispatch write event- Specified by:
dispatchWriteEvent
in classNioController
-
buildSession
protected NioSession buildSession(java.nio.channels.SocketChannel sc)
-
configureSocketChannel
protected final void configureSocketChannel(java.nio.channels.SocketChannel sc) throws java.io.IOException
Confiure socket channel- Parameters:
sc
-- Throws:
java.io.IOException
-
-