Class NioTCPSession

    • Field Detail

      • remoteAddress

        private java.net.InetSocketAddress remoteAddress
    • Constructor Detail

      • NioTCPSession

        public NioTCPSession​(NioSessionConfig sessionConfig,
                             int readRecvBufferSize)
    • Method Detail

      • isExpired

        public final boolean isExpired()
        Description copied from interface: Session
        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.
        Specified by:
        isExpired in interface Session
        Overrides:
        isExpired in class AbstractSession
        Returns:
      • getRemoteSocketAddress

        public java.net.InetSocketAddress getRemoteSocketAddress()
        Description copied from interface: Session
        Return the remote end's InetSocketAddress
        Returns:
      • blockingWrite

        protected final java.lang.Object blockingWrite​(java.nio.channels.SelectableChannel channel,
                                                       WriteMessage message,
                                                       IoBuffer writeBuffer)
                                                throws java.io.IOException,
                                                       java.nio.channels.ClosedChannelException
        Blocking write using temp selector
        Parameters:
        channel -
        message -
        writeBuffer -
        Returns:
        Throws:
        java.io.IOException
        java.nio.channels.ClosedChannelException
      • wrapMessage

        protected WriteMessage wrapMessage​(java.lang.Object msg,
                                           java.util.concurrent.Future<java.lang.Boolean> writeFuture)
        Specified by:
        wrapMessage in class AbstractSession
      • decodeAndDispatch

        private void decodeAndDispatch()
      • blockingRead

        protected final int blockingRead()
                                  throws java.nio.channels.ClosedChannelException,
                                         java.io.IOException
        Blocking read using temp selector
        Returns:
        Throws:
        java.nio.channels.ClosedChannelException
        java.io.IOException
      • socket

        public java.net.Socket socket()
      • closeChannel

        protected final void closeChannel()
                                   throws java.io.IOException
        Overrides:
        closeChannel in class AbstractNioSession
        Throws:
        java.io.IOException