public abstract class AbstractNioSession extends AbstractSession implements NioSession
Session.SessionStatus| 限定符和类型 | 字段和说明 |
|---|---|
protected SelectableChannel |
selectableChannel |
protected SelectorManager |
selectorManager |
attributes, closed, currentMessage, decoder, dispatchMessageDispatcher, encoder, handler, handleReadWriteConcurrently, lastOperationTimeStamp, log, loopback, readBuffer, scheduleWritenBytes, sessionIdleTimeout, sessionTimeout, statistics, useBlockingRead, useBlockingWrite, writeLock, writeQueue| 构造器和说明 |
|---|
AbstractNioSession(NioSessionConfig sessionConfig) |
| 限定符和类型 | 方法和说明 |
|---|---|
SelectableChannel |
channel()
return the channel for this connection
|
protected void |
closeChannel() |
protected long |
doRealWrite(SelectableChannel channel,
IoBuffer buffer) |
void |
enableRead(Selector selector)
Enable read event
|
void |
enableWrite(Selector selector)
Enable write event
|
void |
flush()
Flush the write queue,this method may be no effect if OP_WRITE is
running.
|
protected void |
flush0() |
InetAddress |
getLocalAddress() |
void |
onEvent(EventType event,
Selector selector)
�ɷ�IO�¼�
|
protected void |
onRead(SelectionKey key) |
protected void |
onWrite(SelectionKey key) |
protected abstract void |
readFromBuffer() |
protected void |
registerSession() |
protected boolean |
schduleWriteMessage(WriteMessage writeMessage) |
protected void |
start0() |
protected void |
unregisterChannel() |
protected void |
unregisterSession() |
void |
writeFromUserCode(WriteMessage message) |
protected abstract Object |
writeToChannel(WriteMessage msg) |
clearAttributes, clearWriteQueue, close, decode, dispatchReceivedMessage, getAttribute, getDecoder, getDispatchMessageDispatcher, getEncoder, getHandler, getLastOperationTimeStamp, getReadBuffer, getReadBufferByteOrder, getScheduleWritenBytes, getSessionIdleTimeout, getSessionTimeout, getStatistics, getWriteLock, getWriteQueue, isClosed, isExpired, isHandleReadWriteConcurrently, isIdle, isLoopbackConnection, isUseBlockingRead, isUseBlockingWrite, onClosed, onConnected, onCreated, onException, onExpired, onIdle, onStarted, preprocessWriteMessage, removeAttribute, setAttribute, setAttributeIfAbsent, setClosed, setDecoder, setEncoder, setHandleReadWriteConcurrently, setReadBuffer, setReadBufferByteOrder, setSessionIdleTimeout, setSessionTimeout, setUseBlockingRead, setUseBlockingWrite, start, transferFrom, transferTo, updateTimeStamp, wrapMessage, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearAttributes, close, getAttribute, getDecoder, getEncoder, getHandler, getLastOperationTimeStamp, getReadBufferByteOrder, getRemoteSocketAddress, getScheduleWritenBytes, getSessionIdleTimeout, getSessionTimeout, isClosed, isExpired, isHandleReadWriteConcurrently, isIdle, isLoopbackConnection, isUseBlockingRead, isUseBlockingWrite, removeAttribute, setAttribute, setAttributeIfAbsent, setDecoder, setEncoder, setHandleReadWriteConcurrently, setReadBufferByteOrder, setSessionIdleTimeout, setSessionTimeout, setUseBlockingRead, setUseBlockingWrite, start, writeprotected SelectorManager selectorManager
protected SelectableChannel selectableChannel
public AbstractNioSession(NioSessionConfig sessionConfig)
public SelectableChannel channel()
NioSessionchannel 在接口中 NioSessionpublic final void enableRead(Selector selector)
NioSessionenableRead 在接口中 NioSessionprotected void start0()
start0 在类中 AbstractSessionpublic InetAddress getLocalAddress()
getLocalAddress 在接口中 Sessionprotected abstract Object writeToChannel(WriteMessage msg) throws ClosedChannelException, IOException
protected void onWrite(SelectionKey key)
public final void enableWrite(Selector selector)
NioSessionenableWrite 在接口中 NioSessionprotected void onRead(SelectionKey key)
protected abstract void readFromBuffer()
protected void closeChannel()
throws IOException
closeChannel 在类中 AbstractSessionIOExceptionprotected final void unregisterChannel()
throws IOException
IOExceptionprotected final void registerSession()
protected void unregisterSession()
public void writeFromUserCode(WriteMessage message)
writeFromUserCode 在类中 AbstractSessionprotected boolean schduleWriteMessage(WriteMessage writeMessage)
public void flush()
Sessionprotected final void flush0()
protected final long doRealWrite(SelectableChannel channel, IoBuffer buffer) throws IOException
IOExceptionpublic final void onEvent(EventType event, Selector selector)
onEvent 在接口中 NioSessionCopyright © 2013. All Rights Reserved.