Package com.yahoo.jrt

Class Acceptor

java.lang.Object
com.yahoo.jrt.Acceptor

public class Acceptor extends Object
A class used to listen on a network socket. A separate thread is used to accept connections and register them with the underlying transport thread. To create an acceptor you need to invoke the listen method in the Supervisor class.
  • Method Details

    • port

      public int port()
      Obtain the local port number this Acceptor is listening to. If this Acceptor is no longer listening (it has been shut down), -1 will be returned.
      Returns:
      listening port, or -1 if not listening
    • spec

      public Spec spec()
      Obtain the Spec for the local port and host interface this Acceptor is listening to. If this Acceptor is no longer listening (it has been shut down), null will be returned.
      Returns:
      listening spec, or null if not listening
    • shutdown

      public Acceptor shutdown()
      Initiate controlled shutdown of the acceptor thread
      Returns:
      this object, to enable chaining with join
    • join

      public void join()
      Wait for the acceptor thread to finish