Class DefaultListeningIOReactor

    • Constructor Detail

      • DefaultListeningIOReactor

        public DefaultListeningIOReactor​(IOReactorConfig config,
                                         java.util.concurrent.ThreadFactory threadFactory)
                                  throws IOReactorException
        Creates an instance of DefaultListeningIOReactor with the given configuration.
        Parameters:
        config - I/O reactor configuration.
        threadFactory - the factory to create threads. Can be null.
        Throws:
        IOReactorException - in case if a non-recoverable I/O error.
        Since:
        4.2
      • DefaultListeningIOReactor

        public DefaultListeningIOReactor​(IOReactorConfig config)
                                  throws IOReactorException
        Creates an instance of DefaultListeningIOReactor with the given configuration.
        Parameters:
        config - I/O reactor configuration. Can be null.
        Throws:
        IOReactorException - in case if a non-recoverable I/O error.
        Since:
        4.2
      • DefaultListeningIOReactor

        public DefaultListeningIOReactor()
                                  throws IOReactorException
        Creates an instance of DefaultListeningIOReactor with default configuration.
        Throws:
        IOReactorException - in case if a non-recoverable I/O error.
        Since:
        4.2
    • Method Detail

      • listen

        public ListenerEndpoint listen​(java.net.SocketAddress address)
        Description copied from interface: ListeningIOReactor
        Opens a new listener endpoint with the given socket address. Once the endpoint is fully initialized it starts accepting incoming connections and propagates I/O activity notifications to the I/O event dispatcher.

        ListenerEndpoint.waitFor() can be used to wait for the listener to be come ready to accept incoming connections.

        ListenerEndpoint.close() can be used to shut down the listener even before it is fully initialized.

        Specified by:
        listen in interface ListeningIOReactor
        Parameters:
        address - the socket address to listen on.
        Returns:
        listener endpoint.
      • pause

        public void pause()
                   throws java.io.IOException
        Description copied from interface: ListeningIOReactor
        Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.
        Specified by:
        pause in interface ListeningIOReactor
        Throws:
        java.io.IOException - in case of an I/O error.
      • resume

        public void resume()
                    throws java.io.IOException
        Description copied from interface: ListeningIOReactor
        Resumes the I/O reactor restoring its ability to accept incoming connections on all active endpoints.
        Specified by:
        resume in interface ListeningIOReactor
        Throws:
        java.io.IOException - in case of an I/O error.