Module org.snmp4j

Class TLSTM.ServerThread

    • Field Detail

      • lastError

        private java.lang.Throwable lastError
      • ssc

        private java.nio.channels.ServerSocketChannel ssc
      • outQueue

        private final java.util.concurrent.BlockingQueue<TLSTM.SocketEntry> outQueue
      • inQueue

        private final java.util.concurrent.BlockingQueue<TLSTM.SocketEntry> inQueue
    • Constructor Detail

      • ServerThread

        public ServerThread()
                     throws java.io.IOException,
                            java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.NoSuchAlgorithmException
    • Method Detail

      • processQueues

        private void processQueues()
      • isConnectionClosed

        private boolean isConnectionClosed​(TLSTM.SocketEntry entry,
                                           java.io.IOException ioException)
      • closeChannelAndRemoveSocket

        private void closeChannelAndRemoveSocket​(TLSTM.SocketEntry entry,
                                                 java.io.IOException ioException)
      • processPending

        private void processPending()
      • runDelegatedTasks

        public boolean runDelegatedTasks​(javax.net.ssl.SSLEngineResult result,
                                         TLSTM.SocketEntry entry)
                                  throws java.io.IOException
        If the result indicates that we have outstanding tasks to do, go ahead and run them in this thread.
        Parameters:
        result - the SSLEngine wrap/unwrap result.
        entry - the session to use.
        Returns:
        true if processing of delegated tasks has been finished, false otherwise.
        Throws:
        java.io.IOException
      • getLastError

        public java.lang.Throwable getLastError()
      • sendMessage

        public void sendMessage​(Address address,
                                byte[] message,
                                TransportStateReference tmStateReference)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • readMessage

        private void readMessage​(java.nio.channels.SelectionKey sk,
                                 java.nio.channels.SocketChannel readChannel,
                                 TcpAddress incomingAddress,
                                 TLSTM.SocketEntry session)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • dispatchMessage

        private void dispatchMessage​(TcpAddress incomingAddress,
                                     java.nio.ByteBuffer byteBuffer,
                                     long bytesRead,
                                     java.lang.Object sessionID,
                                     TransportStateReference tmStateReference)
      • writeMessage

        private void writeMessage​(TLSTM.SocketEntry entry,
                                  java.nio.channels.SocketChannel sc)
                           throws java.io.IOException
        Throws:
        java.io.IOException