Dee.Server

g Dee.Peer Dee.Peer Dee.Server Dee.Server Dee.Peer->Dee.Server GObject.Object GObject.Object GObject.Object->Dee.Peer

Subclasses:

None

Methods

Inherited:

Dee.Peer (7), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

bus_address_for_name (name, include_username)

class

new (swarm_name)

class

new_for_address (swarm_name, bus_address)

get_client_address ()

Virtual Methods

Inherited:

Dee.Peer (8), GObject.Object (7)

Properties

Inherited:

Dee.Peer (3)

Name

Type

Flags

Short Description

bus-address

str

r/w/co

Bus address to use for the connection

same-user-only

bool

r/w/co

Accept connections from current user only

Signals

Inherited:

Dee.Peer (4), GObject.Object (1)

Fields

Inherited:

Dee.Peer (4), GObject.Object (1)

Name

Type

Access

Description

parent

Dee.Peer

r

priv

Dee.ServerPrivate

r

Class Details

class Dee.Server(**kwargs)
Bases:

Dee.Peer

Abstract:

No

Structure:

Dee.ServerClass

classmethod bus_address_for_name(name, include_username)
Parameters:
  • name (str) – A name to create bus address for.

  • include_username (bool) – Include current user name as part of the bus address.

Returns:

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

Return type:

str

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

classmethod new(swarm_name)
Parameters:

swarm_name (str) – Name of swarm to join.

Returns:

A newly constructed Dee.Server.

Return type:

Dee.Server

Creates a new instance of Dee.Server and tries to bind to Dee.Server :bus-address. The Dee.Peer :swarm-leader property will be set when the binding succeeds.

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

classmethod new_for_address(swarm_name, bus_address)
Parameters:
  • swarm_name (str) – Name of swarm to join.

  • bus_address (str) – D-Bus address to use for the connection.

Returns:

A newly constructed Dee.Server.

Return type:

Dee.Server

Creates a new instance of Dee.Server and tries to bind to bus_address. The Dee.Peer :swarm-leader property will be set when the binding succeeds.

If there is already a Dee.Server 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 Dee.Server 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).

get_client_address()
Returns:

A D-Bus address string. Do not free.

Return type:

str

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

Property Details

Dee.Server.props.bus_address
Name:

bus-address

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Bus address to use for the connection

Dee.Server.props.same_user_only
Name:

same-user-only

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Accept connections from current user only