Package one.nio.net

Class Session

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    HttpSession, MultiAcceptSession, RpcSession

    public class Session
    extends java.lang.Object
    implements java.io.Closeable
    • Constructor Detail

      • Session

        public Session​(Socket socket)
      • Session

        public Session​(Socket socket,
                       int eventsToListen)
    • Method Detail

      • getRemoteHost

        public final java.lang.String getRemoteHost()
      • socket

        public final Socket socket()
      • lastAccessTime

        public final long lastAccessTime()
      • isSsl

        public boolean isSsl()
      • checkStatus

        public int checkStatus​(long currentTime,
                               long keepAlive)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
      • scheduleClose

        public void scheduleClose()
      • getQueueStats

        public void getQueueStats​(long[] stats)
      • listen

        public void listen​(int newEventsToListen)
      • read

        public int read​(byte[] data,
                        int offset,
                        int count)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readRaw

        public int readRaw​(long address,
                           int count)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public final void write​(byte[] data,
                                int offset,
                                int count)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public final void write​(byte[] data,
                                int offset,
                                int count,
                                int flags)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public final void write​(Session.QueueItem item)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • processRead

        protected void processRead​(byte[] buffer)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • processWrite

        protected void processWrite()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • process

        public void process​(byte[] buffer)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • handleException

        public void handleException​(java.lang.Throwable e)