Class NioEndpoint.NioSocketWrapper

    • Method Detail

      • interestOps

        public int interestOps()
      • interestOps

        public int interestOps​(int ops)
      • getReadLatch

        public java.util.concurrent.CountDownLatch getReadLatch()
      • getWriteLatch

        public java.util.concurrent.CountDownLatch getWriteLatch()
      • resetLatch

        protected java.util.concurrent.CountDownLatch resetLatch​(java.util.concurrent.CountDownLatch latch)
      • resetReadLatch

        public void resetReadLatch()
      • resetWriteLatch

        public void resetWriteLatch()
      • startLatch

        protected java.util.concurrent.CountDownLatch startLatch​(java.util.concurrent.CountDownLatch latch,
                                                                 int cnt)
      • startReadLatch

        public void startReadLatch​(int cnt)
      • startWriteLatch

        public void startWriteLatch​(int cnt)
      • awaitLatch

        protected void awaitLatch​(java.util.concurrent.CountDownLatch latch,
                                  long timeout,
                                  java.util.concurrent.TimeUnit unit)
                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • awaitReadLatch

        public void awaitReadLatch​(long timeout,
                                   java.util.concurrent.TimeUnit unit)
                            throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • awaitWriteLatch

        public void awaitWriteLatch​(long timeout,
                                    java.util.concurrent.TimeUnit unit)
                             throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • updateLastWrite

        public void updateLastWrite()
      • getLastWrite

        public long getLastWrite()
      • updateLastRead

        public void updateLastRead()
      • getLastRead

        public long getLastRead()
      • read

        public int read​(boolean block,
                        byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Specified by:
        read in class SocketWrapperBase<NioChannel>
        Throws:
        java.io.IOException
      • read

        public int read​(boolean block,
                        java.nio.ByteBuffer to)
                 throws java.io.IOException
        Specified by:
        read in class SocketWrapperBase<NioChannel>
        Throws:
        java.io.IOException
      • doClose

        protected void doClose()
        Description copied from class: SocketWrapperBase
        Perform the actual close. The closed atomic boolean guarantees this will be called only once per wrapper.
        Specified by:
        doClose in class SocketWrapperBase<NioChannel>
      • doWrite

        protected void doWrite​(boolean block,
                               java.nio.ByteBuffer from)
                        throws java.io.IOException
        Description copied from class: SocketWrapperBase
        Write the contents of the ByteBuffer to the socket. For blocking writes either then entire contents of the buffer will be written or an IOException will be thrown. Partial blocking writes will not occur.
        Specified by:
        doWrite in class SocketWrapperBase<NioChannel>
        Parameters:
        block - Should the write be blocking or not?
        from - the ByteBuffer containing the data to be written
        Throws:
        java.io.IOException - If an I/O error such as a timeout occurs during the write
      • processSendfile

        public SendfileState processSendfile​(SendfileDataBase sendfileData)
        Description copied from class: SocketWrapperBase
        Starts the sendfile process. It is expected that if the sendfile process does not complete during this call and does not report an error, that the caller will not add the socket to the poller (or equivalent). That is the responsibility of this method.
        Specified by:
        processSendfile in class SocketWrapperBase<NioChannel>
        Parameters:
        sendfileData - Data representing the file to send
        Returns:
        The state of the sendfile process after the first write.
      • doClientAuth

        public void doClientAuth​(SSLSupport sslSupport)
                          throws java.io.IOException
        Description copied from class: SocketWrapperBase
        Require the client to perform CLIENT-CERT authentication if it hasn't already done so.
        Specified by:
        doClientAuth in class SocketWrapperBase<NioChannel>
        Parameters:
        sslSupport - The SSL/TLS support instance currently being used by the connection that may need updating after the client authentication
        Throws:
        java.io.IOException - If authentication is required then there will be I/O with the client and this exception will be thrown if that goes wrong