public class NioTCPSession extends AbstractNioSession
Session.SessionStatusselectableChannel, selectorManagerattributes, closed, currentMessage, decoder, dispatchMessageDispatcher, encoder, handler, handleReadWriteConcurrently, lastOperationTimeStamp, log, loopback, readBuffer, scheduleWritenBytes, sessionIdleTimeout, sessionTimeout, statistics, useBlockingRead, useBlockingWrite, writeLock, writeQueue| 构造器和说明 |
|---|
NioTCPSession(NioSessionConfig sessionConfig,
int readRecvBufferSize) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected int |
blockingRead()
Blocking read using temp selector
|
protected Object |
blockingWrite(SelectableChannel channel,
WriteMessage message,
IoBuffer writeBuffer)
Blocking write using temp selector
|
protected void |
closeChannel() |
void |
decode()
Decode buffer
|
InetSocketAddress |
getRemoteSocketAddress()
Return the remote end's InetSocketAddress
|
boolean |
isExpired()
Return true if session is expired,session is expired beacause you set the
sessionTimeout,if since session's last operation form now is over this
vlaue,isExpired return true,and Handler.onExpired() will be invoked.
|
protected void |
readFromBuffer() |
Socket |
socket() |
protected WriteMessage |
wrapMessage(Object msg,
Future<Boolean> writeFuture) |
protected Object |
writeToChannel(WriteMessage message) |
channel, doRealWrite, enableRead, enableWrite, flush, flush0, getLocalAddress, onEvent, onRead, onWrite, registerSession, schduleWriteMessage, start0, unregisterChannel, unregisterSession, writeFromUserCodeclearAttributes, clearWriteQueue, close, dispatchReceivedMessage, getAttribute, getDecoder, getDispatchMessageDispatcher, getEncoder, getHandler, getLastOperationTimeStamp, getReadBuffer, getReadBufferByteOrder, getScheduleWritenBytes, getSessionIdleTimeout, getSessionTimeout, getStatistics, getWriteLock, getWriteQueue, isClosed, 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, writeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearAttributes, close, getAttribute, getDecoder, getEncoder, getHandler, getLastOperationTimeStamp, getReadBufferByteOrder, getScheduleWritenBytes, getSessionIdleTimeout, getSessionTimeout, isClosed, isHandleReadWriteConcurrently, isIdle, isLoopbackConnection, isUseBlockingRead, isUseBlockingWrite, removeAttribute, setAttribute, setAttributeIfAbsent, setDecoder, setEncoder, setHandleReadWriteConcurrently, setReadBufferByteOrder, setSessionIdleTimeout, setSessionTimeout, setUseBlockingRead, setUseBlockingWrite, start, writepublic NioTCPSession(NioSessionConfig sessionConfig, int readRecvBufferSize)
public final boolean isExpired()
SessionisExpired 在接口中 SessionisExpired 在类中 AbstractSessionprotected Object writeToChannel(WriteMessage message) throws IOException
writeToChannel 在类中 AbstractNioSessionIOExceptionpublic InetSocketAddress getRemoteSocketAddress()
Sessionprotected final Object blockingWrite(SelectableChannel channel, WriteMessage message, IoBuffer writeBuffer) throws IOException, ClosedChannelException
channel - message - writeBuffer - IOExceptionClosedChannelExceptionprotected WriteMessage wrapMessage(Object msg, Future<Boolean> writeFuture)
wrapMessage 在类中 AbstractSessionprotected void readFromBuffer()
readFromBuffer 在类中 AbstractNioSessionprotected final int blockingRead()
throws ClosedChannelException,
IOException
ClosedChannelExceptionIOExceptionpublic void decode()
decode 在类中 AbstractSessionpublic Socket socket()
protected final void closeChannel()
throws IOException
closeChannel 在类中 AbstractNioSessionIOExceptionCopyright © 2013. All Rights Reserved.