Class SocketListener.Builder<B extends SocketListener.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
SocketService.Builder
Enclosing class:
SocketListener

public static class SocketListener.Builder<B extends SocketListener.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
Since:
2.22
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public SocketListener build()
      Finish building the SocketListener object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to SocketListener.
      Overrides:
      build in class GObject.Builder<B extends SocketListener.Builder<B>>
      Returns:
      a new instance of SocketListener with the properties that were set in the Builder object.
    • setListenBacklog

      public B setListenBacklog(int listenBacklog)
      The number of outstanding connections in the listen queue.
      Parameters:
      listenBacklog - the value for the listen-backlog property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.22
    • onEvent

      public B onEvent(SocketListener.EventCallback handler)
      Emitted when listener's activity on socket changes state. Note that when listener is used to listen on both IPv4 and IPv6, a separate set of signals will be emitted for each, and the order they happen in is undefined.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.46
      See Also: