index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
DBusServer
[
group__DBus.html
D-BUS low-level public API
]
Server that listens for new connections.
#_details
More...
Typedefs
typedef
structDBusServer.html
DBusServer
group__DBusServer.html#ga17
DBusServer
An opaque object representing a server that listens for connections from other applications.
#ga17
Functions
structDBusServer.html
DBusServer
*
group__DBusServer.html#ga1
dbus_server_listen
(const char *address,
structDBusError.html
DBusError
*error)
Listens for new connections on the given address.
#ga1
structDBusServer.html
DBusServer
*
group__DBusServer.html#ga2
dbus_server_ref
(
structDBusServer.html
DBusServer
*server)
Increments the reference count of a
structDBusServer.html
DBusServer
.
#ga2
void
group__DBusServer.html#ga3
dbus_server_unref
(
structDBusServer.html
DBusServer
*server)
Decrements the reference count of a
structDBusServer.html
DBusServer
.
#ga3
void
group__DBusServer.html#ga4
_dbus_server_ref_unlocked
(
structDBusServer.html
DBusServer
*server)
Like
group__DBusServer.html#ga2
dbus_server_ref()
but does not acquire the lock (must already be held).
#ga4
void
group__DBusServer.html#ga5
_dbus_server_unref_unlocked
(
structDBusServer.html
DBusServer
*server)
Like
group__DBusServer.html#ga3
dbus_server_unref()
but does not acquire the lock (must already be held).
#ga5
void
group__DBusServer.html#ga6
dbus_server_disconnect
(
structDBusServer.html
DBusServer
*server)
Releases the server's address and stops listening for new clients.
#ga6
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga7
dbus_server_get_is_connected
(
structDBusServer.html
DBusServer
*server)
Returns
group__DBusMacros.html#ga2
TRUE
if the server is still listening for new connections.
#ga7
char *
group__DBusServer.html#ga8
dbus_server_get_address
(
structDBusServer.html
DBusServer
*server)
Returns the address of the server, as a newly-allocated string which must be freed by the caller.
#ga8
void
group__DBusServer.html#ga9
dbus_server_set_new_connection_function
(
structDBusServer.html
DBusServer
*server, DBusNewConnectionFunction function, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
Sets a function to be used for handling new connections.
#ga9
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga10
dbus_server_set_watch_functions
(
structDBusServer.html
DBusServer
*server, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
Sets the watch functions for the connection.
#ga10
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga11
dbus_server_set_timeout_functions
(
structDBusServer.html
DBusServer
*server, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function)
Sets the timeout functions for the connection.
#ga11
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga12
dbus_server_set_auth_mechanisms
(
structDBusServer.html
DBusServer
*server, const char **mechanisms)
Sets the authentication mechanisms that this server offers to clients, as a list of SASL mechanisms.
#ga12
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga13
dbus_server_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
Allocates an integer ID to be used for storing application-specific data on any
structDBusServer.html
DBusServer
.
#ga13
void
group__DBusServer.html#ga14
dbus_server_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*slot_p)
Deallocates a global ID for server data slots.
#ga14
group__DBusTypes.html#ga2
dbus_bool_t
group__DBusServer.html#ga15
dbus_server_set_data
(
structDBusServer.html
DBusServer
*server, int slot, void *data,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func)
Stores a pointer on a
structDBusServer.html
DBusServer
, along with an optional function to be used for freeing the data when the data is set again, or when the server is finalized.
#ga15
void *
group__DBusServer.html#ga16
dbus_server_get_data
(
structDBusServer.html
DBusServer
*server, int slot)
Retrieves data previously set with
group__DBusServer.html#ga15
dbus_server_set_data()
.
#ga16
Detailed Description
Server that listens for new connections.
Types and functions related to
structDBusServer.html
DBusServer
. A
structDBusServer.html
DBusServer
represents a server that other applications can connect to. Each connection from another application is represented by a
structDBusConnection.html
DBusConnection
.
todo.html#_todo000062
Todo:
Thread safety hasn't been looked at for
structDBusServer.html
DBusServer
Need notification to apps of disconnection, may matter for some transports
Typedef Documentation
structDBusServer.html
DBusServer
An opaque object representing a server that listens for connections from other applications.
Each time a connection is made, a new
structDBusConnection.html
DBusConnection
is created and made available via an application-provided DBusNewConnectionFunction. The DBusNewConnectionFunction is provided with
group__DBusServer.html#ga9
dbus_server_set_new_connection_function()
.
Definition at line
dbus-server_8h-source.html#l00037
37
of file
dbus-server_8h-source.html
dbus-server.h
.
Function Documentation
void _dbus_server_ref_unlocked
(
structDBusServer.html
DBusServer
*
server
)
Like
group__DBusServer.html#ga2
dbus_server_ref()
but does not acquire the lock (must already be held).
Parameters:
server
the server.
Definition at line
dbus-server_8c-source.html#l00738
738
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01809
_dbus_atomic_inc()
,
group__DBusMacros.html#ga4
NULL
,
dbus-server-protected_8h-source.html#l00067
refcount
, and
dbus-sysdeps_8h-source.html#l00192
DBusAtomic::value
.
Referenced by
dbus-server_8c-source.html#l00799
dbus_server_disconnect()
.
void _dbus_server_unref_unlocked
(
structDBusServer.html
DBusServer
*
server
)
Like
group__DBusServer.html#ga3
dbus_server_unref()
but does not acquire the lock (must already be held).
Parameters:
server
the server.
Definition at line
dbus-server_8c-source.html#l00760
760
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01832
_dbus_atomic_dec()
,
dbus-server-protected_8h-source.html#l00095
disconnected
,
structDBusServerVTable.html#o0
DBusServerVTable::finalize
,
group__DBusMacros.html#ga4
NULL
,
dbus-server-protected_8h-source.html#l00067
refcount
,
dbus-sysdeps_8h-source.html#l00192
DBusAtomic::value
, and
dbus-server-protected_8h-source.html#l00068
vtable
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_server_allocate_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_p
)
Allocates an integer ID to be used for storing application-specific data on any
structDBusServer.html
DBusServer
.
The allocated ID may then be used with
group__DBusServer.html#ga15
dbus_server_set_data()
and
group__DBusServer.html#ga16
dbus_server_get_data()
. The slot must be initialized with -1. If a nonnegative slot is passed in, the refcount is incremented on that slot, rather than creating a new slot.
The allocated slot is global, i.e. all
structDBusServer.html
DBusServer
objects will have a slot with the given integer ID reserved.
Parameters:
slot_p
address of global variable storing the slot ID
Returns:
group__DBusMacros.html#ga3
FALSE
on no memory
Definition at line
dbus-server_8c-source.html#l01060
1060
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-dataslot_8c-source.html#l00067
_dbus_data_slot_allocator_alloc()
, and
dbus-internals_8h-source.html#l00267
_DBUS_LOCK_NAME
.
Referenced by
dbus-gmain_8c-source.html#l00639
dbus_server_setup_with_g_main()
.
void dbus_server_disconnect
(
structDBusServer.html
DBusServer
*
server
)
Releases the server's address and stops listening for new clients.
If called more than once, only the first call has an effect. Does not modify the server's reference count.
Parameters:
server
the server.
Definition at line
dbus-server_8c-source.html#l00799
799
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-server_8c-source.html#l00738
_dbus_server_ref_unlocked()
,
dbus-server_8c-source.html#l00701
dbus_server_unref()
,
structDBusServerVTable.html#o1
DBusServerVTable::disconnect
,
dbus-server-protected_8h-source.html#l00095
disconnected
,
group__DBusMacros.html#ga4
NULL
,
dbus-server-protected_8h-source.html#l00067
refcount
,
group__DBusMacros.html#ga2
TRUE
,
dbus-sysdeps_8h-source.html#l00192
DBusAtomic::value
, and
dbus-server-protected_8h-source.html#l00068
vtable
.
Referenced by
server_8cpp-source.html#l00061
DBusQt::Server::disconnect()
.
void dbus_server_free_data_slot
(
group__DBusTypes.html#ga4
dbus_int32_t
*
slot_p
)
Deallocates a global ID for server data slots.
group__DBusServer.html#ga16
dbus_server_get_data()
and
group__DBusServer.html#ga15
dbus_server_set_data()
may no longer be used with this slot. Existing data stored on existing
structDBusServer.html
DBusServer
objects will be freed when the server is finalized, but may not be retrieved (and may only be replaced if someone else reallocates the slot).
Parameters:
slot_p
address of the slot to deallocate
Definition at line
dbus-server_8c-source.html#l01079
1079
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-dataslot_8c-source.html#l00161
_dbus_data_slot_allocator_free()
.
char* dbus_server_get_address
(
structDBusServer.html
DBusServer
*
server
)
Returns the address of the server, as a newly-allocated string which must be freed by the caller.
Parameters:
server
the server
Returns:
the address or
group__DBusMacros.html#ga4
NULL
if no memory
Definition at line
dbus-server_8c-source.html#l00848
848
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8c-source.html#l00303
_dbus_strdup()
,
dbus-server-protected_8h-source.html#l00078
address
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
server_8cpp-source.html#l00066
DBusQt::Server::address()
.
void* dbus_server_get_data
(
structDBusServer.html
DBusServer
*
server
,
int
slot
)
Retrieves data previously set with
group__DBusServer.html#ga15
dbus_server_set_data()
.
The slot must still be allocated (must not have been freed).
Parameters:
server
the server
slot
the slot to get data from
Returns:
the data, or
group__DBusMacros.html#ga4
NULL
if not found
Definition at line
dbus-server_8c-source.html#l01140
1140
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-dataslot_8c-source.html#l00295
_dbus_data_slot_list_get()
,
group__DBusMacros.html#ga4
NULL
, and
dbus-server-protected_8h-source.html#l00082
slot_list
.
Referenced by
dbus-gmain_8c-source.html#l00639
dbus_server_setup_with_g_main()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_server_get_is_connected
(
structDBusServer.html
DBusServer
*
server
)
Returns
group__DBusMacros.html#ga2
TRUE
if the server is still listening for new connections.
Parameters:
server
the server.
Definition at line
dbus-server_8c-source.html#l00827
827
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-server-protected_8h-source.html#l00095
disconnected
,
group__DBusMacros.html#ga3
FALSE
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
server_8cpp-source.html#l00056
DBusQt::Server::isConnected()
.
structDBusServer.html
DBusServer
* dbus_server_listen
(
const char *
address
,
structDBusError.html
DBusError
*
error
)
Listens for new connections on the given address.
Returns
group__DBusMacros.html#ga4
NULL
if listening fails for any reason. Otherwise returns a new
structDBusServer.html
DBusServer
.
group__DBusServer.html#ga9
dbus_server_set_new_connection_function()
and
group__DBusServer.html#ga10
dbus_server_set_watch_functions()
should be called immediately to render the server fully functional.
todo.html#_todo000063
Todo:
error messages on bad address could really be better.
DBusResultCode is a bit limiting here.
Parameters:
address
the address of this server.
error
location to store rationale for failure.
Returns:
a new
structDBusServer.html
DBusServer
, or
group__DBusMacros.html#ga4
NULL
on failure.
Definition at line
dbus-server_8c-source.html#l00486
486
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-sysdeps_8c-source.html#l02363
_dbus_concat_dir_and_file()
,
dbus-sysdeps_8c-source.html#l02523
_dbus_generate_random_ascii()
,
dbus-server-unix_8c-source.html#l00315
_dbus_server_new_for_domain_socket()
,
dbus-server-unix_8c-source.html#l00395
_dbus_server_new_for_tcp_socket()
,
dbus-string_8c-source.html#l00986
_dbus_string_append()
,
dbus-string_8c-source.html#l00261
_dbus_string_free()
,
dbus-string_8c-source.html#l00174
_dbus_string_init()
,
dbus-string_8c-source.html#l00208
_dbus_string_init_const()
,
dbus-sysdeps_8c-source.html#l01134
_dbus_string_parse_int()
,
dbus-address_8c-source.html#l00097
dbus_address_entries_free()
,
dbus-address_8c-source.html#l00133
dbus_address_entry_get_method()
,
dbus-address_8c-source.html#l00146
dbus_address_entry_get_value()
,
dbus-address_8c-source.html#l00320
dbus_parse_address()
,
dbus-errors_8c-source.html#l00313
dbus_set_error()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
structDBusServer.html
DBusServer
* dbus_server_ref
(
structDBusServer.html
DBusServer
*
server
)
Increments the reference count of a
structDBusServer.html
DBusServer
.
Parameters:
server
the server.
Returns:
the server
Definition at line
dbus-server_8c-source.html#l00674
674
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01809
_dbus_atomic_inc()
,
group__DBusMacros.html#ga4
NULL
,
dbus-server-protected_8h-source.html#l00067
refcount
, and
dbus-sysdeps_8h-source.html#l00192
DBusAtomic::value
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_server_set_auth_mechanisms
(
structDBusServer.html
DBusServer
*
server
,
const char **
mechanisms
)
Sets the authentication mechanisms that this server offers to clients, as a list of SASL mechanisms.
This function only affects connections created *after* it is called. Pass
group__DBusMacros.html#ga4
NULL
instead of an array to use all available mechanisms.
Parameters:
server
the server
mechanisms
group__DBusMacros.html#ga4
NULL
-terminated array of mechanisms
Returns:
group__DBusMacros.html#ga3
FALSE
if no memory
Definition at line
dbus-server_8c-source.html#l01015
1015
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8c-source.html#l00354
_dbus_dup_string_array()
,
dbus-server-protected_8h-source.html#l00093
auth_mechanisms
,
dbus-memory_8c-source.html#l00650
dbus_free_string_array()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
group__DBusMacros.html#ga2
TRUE
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_server_set_data
(
structDBusServer.html
DBusServer
*
server
,
int
slot
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_func
)
Stores a pointer on a
structDBusServer.html
DBusServer
, along with an optional function to be used for freeing the data when the data is set again, or when the server is finalized.
The slot number must have been allocated with
group__DBusServer.html#ga13
dbus_server_allocate_data_slot()
.
Parameters:
server
the server
slot
the slot number
data
the data to store
free_data_func
finalizer function for the data
Returns:
group__DBusMacros.html#ga2
TRUE
if there was enough memory to store the data
Definition at line
dbus-server_8c-source.html#l01100
1100
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-dataslot_8c-source.html#l00233
_dbus_data_slot_list_set()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
dbus-server-protected_8h-source.html#l00082
slot_list
.
Referenced by
dbus-gmain_8c-source.html#l00639
dbus_server_setup_with_g_main()
.
void dbus_server_set_new_connection_function
(
structDBusServer.html
DBusServer
*
server
,
DBusNewConnectionFunction
function
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function
)
Sets a function to be used for handling new connections.
The given function is passed each new connection as the connection is created. If the new connection function increments the connection's reference count, the connection will stay alive. Otherwise, the connection will be unreferenced and closed.
Parameters:
server
the server.
function
a function to handle new connections.
data
data to pass to the new connection handler.
free_data_function
function to free the data.
Definition at line
dbus-server_8c-source.html#l00874
874
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-server-protected_8h-source.html#l00087
new_connection_data
,
dbus-server-protected_8h-source.html#l00089
new_connection_free_data_function
,
dbus-server-protected_8h-source.html#l00085
new_connection_function
, and
group__DBusMacros.html#ga4
NULL
.
Referenced by
dbus-server_8c-source.html#l00195
_dbus_server_finalize_base()
, and
integrator_8cpp-source.html#l00142
DBusQt::Internal::Integrator::Integrator()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_server_set_timeout_functions
(
structDBusServer.html
DBusServer
*
server
,
DBusAddTimeoutFunction
add_function
,
DBusRemoveTimeoutFunction
remove_function
,
DBusTimeoutToggledFunction
toggled_function
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function
)
Sets the timeout functions for the connection.
These functions are responsible for making the application's main loop aware of timeouts.
This function behaves exactly like
group__DBusConnection.html#ga42
dbus_connection_set_timeout_functions()
; see the documentation for that routine.
Parameters:
server
the server.
add_function
function to add a timeout.
remove_function
function to remove a timeout.
toggled_function
function to notify when the timeout is enabled/disabled
data
data to pass to add_function and remove_function.
free_data_function
function to be called to free the data.
Returns:
group__DBusMacros.html#ga3
FALSE
on failure (no memory)
Definition at line
dbus-server_8c-source.html#l00967
967
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-timeout_8c-source.html#l00238
_dbus_timeout_list_set_functions()
,
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
dbus-server-protected_8h-source.html#l00076
timeouts
.
Referenced by
dbus-gmain_8c-source.html#l00639
dbus_server_setup_with_g_main()
, and
integrator_8cpp-source.html#l00142
DBusQt::Internal::Integrator::Integrator()
.
group__DBusTypes.html#ga2
dbus_bool_t
dbus_server_set_watch_functions
(
structDBusServer.html
DBusServer
*
server
,
DBusAddWatchFunction
add_function
,
DBusRemoveWatchFunction
remove_function
,
DBusWatchToggledFunction
toggled_function
,
void *
data
,
group__DBusMemory.html#ga8
DBusFreeFunction
free_data_function
)
Sets the watch functions for the connection.
These functions are responsible for making the application's main loop aware of file descriptors that need to be monitored for events.
This function behaves exactly like
group__DBusConnection.html#ga41
dbus_connection_set_watch_functions()
; see the documentation for that routine.
Parameters:
server
the server.
add_function
function to begin monitoring a new descriptor.
remove_function
function to stop monitoring a descriptor.
toggled_function
function to notify when the watch is enabled/disabled
data
data to pass to add_function and remove_function.
free_data_function
function to be called to free the data.
Returns:
group__DBusMacros.html#ga3
FALSE
on failure (no memory)
Definition at line
dbus-server_8c-source.html#l00914
914
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8c-source.html#l00203
_dbus_warn()
,
dbus-watch_8c-source.html#l00253
_dbus_watch_list_set_functions()
,
group__DBusMacros.html#ga3
FALSE
,
group__DBusMacros.html#ga4
NULL
, and
dbus-server-protected_8h-source.html#l00075
watches
.
Referenced by
dbus-gmain_8c-source.html#l00639
dbus_server_setup_with_g_main()
, and
integrator_8cpp-source.html#l00142
DBusQt::Internal::Integrator::Integrator()
.
void dbus_server_unref
(
structDBusServer.html
DBusServer
*
server
)
Decrements the reference count of a
structDBusServer.html
DBusServer
.
Finalizes the server if the reference count reaches zero.
The server must be disconnected before the refcount reaches zero.
Parameters:
server
the server.
Definition at line
dbus-server_8c-source.html#l00701
701
of file
dbus-server_8c-source.html
dbus-server.c
.
References
dbus-internals_8h-source.html#l00100
_dbus_assert
,
dbus-sysdeps_8c-source.html#l01832
_dbus_atomic_dec()
,
dbus-server-protected_8h-source.html#l00095
disconnected
,
structDBusServerVTable.html#o0
DBusServerVTable::finalize
,
group__DBusMacros.html#ga4
NULL
,
dbus-server-protected_8h-source.html#l00067
refcount
,
dbus-sysdeps_8h-source.html#l00192
DBusAtomic::value
, and
dbus-server-protected_8h-source.html#l00068
vtable
.
Referenced by
dbus-server_8c-source.html#l00799
dbus_server_disconnect()
.
Generated on Tue Sep 13 01:28:09 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
