Class ClientListenerRunner

  • All Implemented Interfaces:
    Runnable
    Direct Known Subclasses:
    SSLClientListenerRunner

    class ClientListenerRunner
    extends Object
    implements Runnable
    Listen for connections on the specified port, and toss them onto the client manager's set of connections once they are established. This is not used for internal (in-JVM) connections - see ClientManager and QueuedClientConnectionRunner. Note that this is extended by SSLClientListenerRunner for SSL, and by DomainClientListenerRunner in Android for domain sockets.
    Author:
    jrandom
    • Field Detail

      • _log

        protected final Log _log
      • _port

        protected final int _port
      • _bindAllInterfaces

        protected final boolean _bindAllInterfaces
      • _running

        protected volatile boolean _running
      • _listening

        protected volatile boolean _listening
      • CONNECT_TIMEOUT

        protected static final int CONNECT_TIMEOUT
        give the i2cp client 5 seconds to show that they're really i2cp clients
        See Also:
        Constant Field Values
    • Method Detail

      • isListening

        public boolean isListening()
      • getServerSocket

        protected ServerSocket getServerSocket()
                                        throws IOException
        Get a ServerSocket. Split out so it can be overridden for SSL.
        Throws:
        IOException
        Since:
        0.8.3
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • runServer

        protected void runServer()
        Start up the socket listener, listens for connections, and fires those connections off via runConnection. This only returns if the socket cannot be opened or there is a catastrophic failure.
      • validate

        protected boolean validate​(Socket socket)
        Verify the first byte.
      • stopListening

        public void stopListening()