Schnittstelle DBusServer.OnNewConnection

Umschließende Klasse:
DBusServer
Funktionsschnittstelle:
Dies ist eine funktionale Schnittstelle, die somit als Zuweisungsziel für einen Lambdaausdruck oder eine Methodenreferenz verwendet werden kann.

@FunctionalInterface public static interface DBusServer.OnNewConnection
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    boolean
    Emitted when a new authenticated connection has been made.
  • Methodendetails

    • onNewConnection

      boolean onNewConnection(@Nonnull DBusConnection connection)
      Emitted when a new authenticated connection has been made. Use
      g_dbus_connection_get_peer_credentials() to figure out what
      identity (if any), was authenticated.

      If you want to accept the connection, take a reference to the
      @connection object and return %TRUE. When you are done with the
      connection call g_dbus_connection_close() and give up your
      reference. Note that the other peer may disconnect at any time -
      a typical thing to do when accepting a connection is to listen to
      the #GDBusConnection::closed signal.

      If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
      then the signal is emitted in a new thread dedicated to the
      connection. Otherwise the signal is emitted in the thread-default
      main context (see [method@GLib.MainContext.push_thread_default])
      of the thread that @server was constructed in.

      You are guaranteed that signal handlers for this signal runs
      before incoming messages on @connection are processed. This means
      that it's suitable to call g_dbus_connection_register_object() or
      similar from the signal handler.
      Parameter:
      connection - A #GDBusConnection for the new connection.
      Gibt zurück:
      %TRUE to claim @connection, %FALSE to let other handlers run.