DeeServer

DeeServer — Creates a server object you can connect to.

Functions

Properties

gchar * bus-address Read / Write / Construct Only
gboolean same-user-only Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── DeePeer
        ╰── DeeServer

Includes

#include <dee.h>

Description

DeeServer allows you to create private connections (connections which are not routed via dbus-daemon). Note that, unlike DeePeer, DeeServer will always be swarm leader, and clients connected to it cannot overtake swarm leadership once the server connection is closed.

Functions

dee_server_bus_address_for_name ()

gchar *
dee_server_bus_address_for_name (const gchar *name,
                                 gboolean include_username);

Helper method which creates bus address string for the given name, which should have the same format as a DBus unique name.

Parameters

name

A name to create bus address for.

 

include_username

Include current user name as part of the bus address.

 

Returns

Newly allocated string with bus address. Use g_free() to free.

[transfer full]


dee_server_get_client_address ()

const gchar *
dee_server_get_client_address (DeeServer *server);

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

Parameters

server

A DeeServer.

 

Returns

A D-Bus address string. Do not free.


dee_server_new ()

DeeServer *
dee_server_new (const gchar *swarm_name);

Creates a new instance of DeeServer and tries to bind to “bus-address”. The “swarm-leader” property will be set when the binding succeeds.

Note that this function will automatically determine the value of “bus-address” property and will generally cause your application to use new socket for every DeeServer with different swarm name. See dee_server_new_for_address() if you'd like to share one connection between multiple DeeServer instances.

Parameters

swarm_name

Name of swarm to join.

 

Returns

A newly constructed DeeServer.

[transfer full]


dee_server_new_for_address ()

DeeServer *
dee_server_new_for_address (const gchar *swarm_name,
                            const gchar *bus_address);

Creates a new instance of DeeServer and tries to bind to bus_address . The “swarm-leader” property will be set when the binding succeeds.

If there is already a DeeServer instance bound to bus_address , the connection will be shared with the newly constructed instance.

This function is primarily meant for sharing of one connection (socket) between multiple DeeServers, so that you can create DeeServer instances with varying swarm names, but the same bus address, which will cause them to share the connection (the sharing is possible only within the same process though).

Parameters

swarm_name

Name of swarm to join.

 

bus_address

D-Bus address to use for the connection.

 

Returns

A newly constructed DeeServer.

[transfer full]

Types and Values

DeeServer

typedef struct _DeeServer DeeServer;


DeeServerClass

typedef struct {
} DeeServerClass;

Property Details

The “bus-address” property

  “bus-address”              gchar *

Bus address to use for the connection.

Flags: Read / Write / Construct Only

Default value: NULL


The “same-user-only” property

  “same-user-only”           gboolean

Accept connections from current user only.

Flags: Read / Write / Construct Only

Default value: TRUE