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.Error 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

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 addMatchAsync(match: String, callback: MessageHandler, installCallback: MessageHandler): Resource

Asynchronously 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
abstract fun enterEventLoopAsync()

Enters I/O event loop on this bus connection in a separate thread

Link copied to clipboard

Gets general method call timeout

Link copied to clipboard
abstract fun getUniqueName(): BusName

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

Link copied to clipboard
abstract suspend fun leaveEventLoop()

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

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)

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

Link copied to clipboard
abstract fun setMethodCallTimeout(timeout: Duration)

Sets general method call timeout

Link copied to clipboard

Convenient way to unify setup of destination.