Connection

interface Connection : Resource

An interface to D-Bus bus connection. Incorporates implementation of both synchronous and asynchronous D-Bus I/O event loop.

All methods throw com.monkopedia.sdbus.SdbusException in case of failure. All methods in this class are thread-aware, but not thread-safe.

Properties

Link copied to clipboard

Provides access to the currently processed D-Bus message

Link copied to clipboard

General method call timeout

Link copied to clipboard
abstract val uniqueName: BusName

The unique name of the connection. E.g. ":1.xx"

Functions

Link copied to clipboard
abstract fun addMatch(match: String, callback: MessageHandler): Resource

Installs a match rule for messages received on this bus connection

Link copied to clipboard
abstract fun addObjectManager(objectPath: ObjectPath): Resource

Adds an ObjectManager at the specified D-Bus object path

Link copied to clipboard
open override fun close()

Closes this resource by delegating to release, enabling use with use { }.

Link copied to clipboard
abstract fun release()

Releases this resource and any child resources it may have.

Link copied to clipboard
abstract fun releaseName(name: ServiceName)

Releases an acquired well-known D-Bus service name on a bus

Link copied to clipboard
abstract fun requestName(name: ServiceName, vararg flags: RequestNameFlag): RequestNameReply

Requests a well-known D-Bus service name on a bus

Link copied to clipboard
abstract fun startEventLoop()

Starts the I/O event loop on this bus connection

Link copied to clipboard
abstract suspend fun stopEventLoop()

Stops the I/O event loop running on this bus connection

Link copied to clipboard

Convenient way to unify setup of destination.