public class NioTcpSession extends AbstractNioSession implements SelectorListener
NioTcpServer and NioTcpClient. A TCP session is a
connection between a our server/client and the remote end-point.IoSession.SessionStatechannelconfig, idleChecker, secured, stateSSL_HELPER| Modifier and Type | Method and Description |
|---|---|
protected void |
channelClose()
Close the inner socket channel
|
protected ByteBuffer |
convertToDirectBuffer(WriteRequest writeRequest,
boolean createNew)
Copy the HeapBuffer into a DirectBuffer, if needed.
|
void |
flushWriteQueue() |
TcpSessionConfig |
getConfig()
Gets the session configuration, it where the idle timeout are set and other transport specific configuration.
|
InetSocketAddress |
getLocalAddress()
Gets the local address of the local peer.
|
InetSocketAddress |
getRemoteAddress()
Returns the socket address of remote peer.
|
boolean |
isReadSuspended()
Is read operation is suspended for this session.
|
boolean |
isWriteSuspended()
Is write operation is suspended for this session.
|
void |
ready(boolean accept,
boolean connect,
boolean read,
ByteBuffer readBuffer,
boolean write) |
void |
resumeRead()
Resumes read operations for this session.
|
void |
resumeWrite()
Resumes write operations for this session.
|
void |
suspendRead()
Suspends read operations for this session.
|
void |
suspendWrite()
Suspends write operations for this session.
|
protected int |
writeDirect(Object message)
Writes the message immediately.
|
close, enqueueWriteRequest, getWriteQueue, isRegisteredForWrite, processWrite, setNotRegisteredForWritecallReadNextFilter, callWriteNextFilter, changeState, getAttribute, getAttribute, getAttributeKeys, getCreationTime, getId, getLastIoTime, getLastReadTime, getLastWriteTime, getReadBytes, getService, getWrittenBytes, incrementWrittenBytes, initSecure, isClosed, isClosing, isConnected, isConnectedSecured, isCreated, isSecured, isSecuring, processException, processMessageReceived, processMessageSent, processMessageWriting, processSessionClosed, processSessionIdle, processSessionOpen, removeAttribute, setAttribute, setSecured, toString, write, writeWithFuturepublic InetSocketAddress getRemoteAddress()
getRemoteAddress in interface IoSessionpublic InetSocketAddress getLocalAddress()
getLocalAddress in interface IoSessionpublic void suspendRead()
suspendRead in interface IoSessionpublic void suspendWrite()
suspendWrite in interface IoSessionprotected int writeDirect(Object message)
writeDirect in class AbstractNioSessionmessage - the message to writeprotected ByteBuffer convertToDirectBuffer(WriteRequest writeRequest, boolean createNew)
convertToDirectBuffer in class AbstractNioSessionwriteRequest - The request containing the HeapBuffercreateNew - A flag to force the creation of a DirectBufferpublic void resumeRead()
resumeRead in interface IoSessionpublic void resumeWrite()
resumeWrite in interface IoSessionpublic boolean isReadSuspended()
isReadSuspended in interface IoSessiontrue if suspendedpublic boolean isWriteSuspended()
isWriteSuspended in interface IoSessiontrue if suspendedpublic TcpSessionConfig getConfig()
protected void channelClose()
channelClose in class AbstractNioSessionpublic void flushWriteQueue()
flushWriteQueue in class AbstractNioSessionpublic void ready(boolean accept,
boolean connect,
boolean read,
ByteBuffer readBuffer,
boolean write)
ready in interface SelectorListenerCopyright © 2009–2013 Apache MINA Project. All rights reserved.