gi-gio-2.0.14: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.DBusServer

Contents

Description

DBusServer is a helper for listening to and accepting D-Bus connections. This can be used to create a new D-Bus server, allowing two peers to use the D-Bus protocol for their own specialized communication. A server instance provided in this way will not perform message routing or implement the org.freedesktop.DBus interface.

To just export an object on a well-known name on a message bus, such as the session or system bus, you should instead use g_bus_own_name().

An example of peer-to-peer communication with G-DBus can be found in gdbus-example-peer.c.

Synopsis

Exported types

Methods

getClientAddress

dBusServerGetClientAddress Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusServer a) 
=> a

server: A DBusServer.

-> m Text

Returns: A D-Bus address string. Do not free, the string is owned by server.

Gets a D-Bus address string that can be used by clients to connect to server.

Since: 2.26

getFlags

dBusServerGetFlags Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusServer a) 
=> a

server: A DBusServer.

-> m [DBusServerFlags]

Returns: A set of flags from the DBusServerFlags enumeration.

Gets the flags for server.

Since: 2.26

getGuid

dBusServerGetGuid Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusServer a) 
=> a

server: A DBusServer.

-> m Text

Returns: A D-Bus GUID. Do not free this string, it is owned by server.

Gets the GUID for server.

Since: 2.26

isActive

dBusServerIsActive Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusServer a) 
=> a

server: A DBusServer.

-> m Bool

Returns: True if server is active, False otherwise.

Gets whether server is active.

Since: 2.26

newSync

dBusServerNewSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusAuthObserver a, IsCancellable b) 
=> Text

address: A D-Bus address.

-> [DBusServerFlags]

flags: Flags from the DBusServerFlags enumeration.

-> Text

guid: A D-Bus GUID.

-> Maybe a

observer: A DBusAuthObserver or Nothing.

-> Maybe b

cancellable: A Cancellable or Nothing.

-> m DBusServer

Returns: A DBusServer or Nothing if error is set. Free with objectUnref. (Can throw GError)

Creates a new D-Bus server that listens on the first address in address that works.

Once constructed, you can use dBusServerGetClientAddress to get a D-Bus address string that clients can use to connect.

Connect to the DBusServer::new-connection signal to handle incoming connections.

The returned DBusServer isn't active - you have to start it with dBusServerStart.

DBusServer is used in this [example][gdbus-peer-to-peer].

This is a synchronous failable constructor. See g_dbus_server_new() for the asynchronous version.

Since: 2.26

start

dBusServerStart Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusServer a) 
=> a

server: A DBusServer.

-> m () 

Starts server.

Since: 2.26

stop

dBusServerStop Source #

Arguments

:: (HasCallStack, MonadIO m, IsDBusServer a) 
=> a

server: A DBusServer.

-> m () 

Stops server.

Since: 2.26

Properties

active

address

authenticationObserver

clientAddress

flags

guid

Signals

newConnection