![]() |
![]() |
![]() |
Dee Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <dee.h> DeeServer; DeeServerClass; gchar * dee_server_bus_address_for_name (const gchar *name
,gboolean include_username
); const gchar * dee_server_get_client_address (DeeServer *server
); DeeServer * dee_server_new (const gchar *swarm_name
); DeeServer * dee_server_new_for_address (const gchar *swarm_name
,const gchar *bus_address
);
"bus-address" gchar* : Read / Write / Construct Only "same-user-only" gboolean : Read / Write / Construct Only
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.
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.
|
A name to create bus address for. |
|
Include current user name as part of the bus address. |
Returns : |
Newly allocated string with bus address.
Use g_free() to free. [transfer full]
|
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.
|
A DeeServer. |
Returns : |
A D-Bus address string. Do not free. |
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.
|
Name of swarm to join. |
Returns : |
A newly constructed DeeServer. [transfer full] |
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).
|
Name of swarm to join. |
|
D-Bus address to use for the connection. |
Returns : |
A newly constructed DeeServer. [transfer full] |
"bus-address"
property"bus-address" gchar* : Read / Write / Construct Only
Bus address to use for the connection.
Default value: NULL
"same-user-only"
property"same-user-only" gboolean : Read / Write / Construct Only
Accept connections from current user only.
Default value: TRUE