Module org.snmp4j

Class AbstractTcpServerThread<S extends AbstractSocketEntry>

    • Field Detail

      • stop

        protected volatile boolean stop
      • selector

        protected java.nio.channels.Selector selector
    • Constructor Detail

      • AbstractTcpServerThread

        public AbstractTcpServerThread​(TcpTransportMapping<?> tcpTransportMapping)
                                throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • connectSocketToSendMessage

        protected void connectSocketToSendMessage​(Address address,
                                                  byte[] message,
                                                  java.net.Socket s,
                                                  S entry,
                                                  java.util.Map<Address,S> sockets)
      • run

        public abstract void run​()
        Specified by:
        run in interface java.lang.Runnable
      • removeSocketEntry

        public abstract S removeSocketEntry​(TcpAddress incomingAddress)
      • connectChannel

        protected void connectChannel​(java.nio.channels.SelectionKey sk,
                                      TcpAddress incomingAddress)
      • writeData

        protected TcpAddress writeData​(java.nio.channels.SelectionKey sk,
                                       TcpAddress incomingAddress)
      • closeChannel

        protected void closeChannel​(java.nio.channels.SelectableChannel channel)
      • close

        public void close​()
      • terminate

        public void terminate​()
        Description copied from interface: WorkerTask
        The WorkerPool might call this method to hint the active WorkTask instance to complete execution as soon as possible.
        Specified by:
        terminate in interface WorkerTask
      • join

        public void join​()
        Description copied from interface: WorkerTask
        Waits until this task has been finished.
        Specified by:
        join in interface WorkerTask
      • interrupt

        public void interrupt​()
        Description copied from interface: WorkerTask
        Interrupts this task.
        Specified by:
        interrupt in interface WorkerTask
        See Also:
        Thread.interrupt()