]>
Commit | Line | Data |
---|---|---|
d97eac36 LP |
1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | ||
5 | <!-- | |
6 | SPDX-License-Identifier: LGPL-2.1+ | |
d97eac36 LP |
7 | --> |
8 | ||
9 | <refentry id="sd_bus_set_connected_signal"> | |
10 | ||
11 | <refentryinfo> | |
12 | <title>sd_bus_set_connected_signal</title> | |
13 | <productname>systemd</productname> | |
14 | ||
15 | <authorgroup> | |
16 | <author> | |
17 | <contrib>Developer</contrib> | |
18 | <firstname>Lennart</firstname> | |
19 | <surname>Poettering</surname> | |
20 | <email>lennart@poettering.net</email> | |
21 | </author> | |
22 | </authorgroup> | |
23 | </refentryinfo> | |
24 | ||
25 | <refmeta> | |
26 | <refentrytitle>sd_bus_set_connected_signal</refentrytitle> | |
27 | <manvolnum>3</manvolnum> | |
28 | </refmeta> | |
29 | ||
30 | <refnamediv> | |
31 | <refname>sd_bus_set_connected_signal</refname> | |
32 | <refname>sd_bus_get_connected_signal</refname> | |
33 | ||
34 | <refpurpose>Control emmission of local connection establishment signal on bus connections</refpurpose> | |
35 | </refnamediv> | |
36 | ||
37 | <refsynopsisdiv> | |
38 | <funcsynopsis> | |
39 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
40 | ||
41 | <funcprototype> | |
42 | <funcdef>int <function>sd_bus_set_connected_signal</function></funcdef> | |
43 | <paramdef>sd_bus *<parameter>bus</parameter></paramdef> | |
44 | <paramdef>int <parameter>b</parameter></paramdef> | |
45 | </funcprototype> | |
46 | ||
47 | <funcprototype> | |
48 | <funcdef>int <function>sd_bus_get_connected_signal</function></funcdef> | |
49 | <paramdef>sd_bus *<parameter>bus</parameter></paramdef> | |
50 | </funcprototype> | |
51 | ||
52 | </funcsynopsis> | |
53 | </refsynopsisdiv> | |
54 | ||
55 | <refsect1> | |
56 | <title>Description</title> | |
57 | ||
58 | <para><function>sd_bus_set_connected_signal()</function> may be used to control whether a local, synthetic | |
59 | <function>Connected()</function> signal message shall be generated and enqueued for dispatching when the connection | |
60 | is fully established. If the <parameter>b</parameter> parameter is zero the message is not generated (the default), | |
61 | otherwise it is generated.</para> | |
62 | ||
63 | <para><function>sd_bus_get_connected_signal()</function> may be used to query whether this feature is enabled. It | |
64 | returns zero if not, positive otherwise.</para> | |
65 | ||
66 | <para>The <function>Connected()</function> signal message is generated from the | |
67 | <literal>org.freedesktop.DBus.Local</literal> service and interface, and | |
68 | <literal>/org/freedesktop/DBus/Local</literal> object path. Use | |
69 | <citerefentry><refentrytitle>sd_bus_match_signal_async</refentrytitle><manvolnum>3</manvolnum></citerefentry> to | |
70 | match on this signal.</para> | |
71 | ||
72 | <para>This message is particularly useful on slow transports where connections take a long time to be | |
73 | established. This is especially the case when | |
74 | <citerefentry><refentrytitle>sd_bus_set_watch_bind</refentrytitle><manvolnum>3</manvolnum></citerefentry> is | |
75 | used. The signal is generated when the | |
76 | <citerefentry><refentrytitle>sd_bus_is_ready</refentrytitle><manvolnum>3</manvolnum></citerefentry> returns | |
77 | positive for the first time.</para> | |
78 | ||
79 | <para>The <function>Connected()</function> signal corresponds with the <function>Disconnected()</function> signal | |
80 | that is synthesized locally when the connection is terminated. The latter is generated unconditionally however, | |
81 | unlike the former which needs to be enabled explicitly before it is generated, with | |
82 | <function>sd_bus_set_connected_signal()</function>.</para> | |
83 | </refsect1> | |
84 | ||
85 | <refsect1> | |
86 | <title>Return Value</title> | |
87 | ||
88 | <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style | |
89 | error code.</para> | |
90 | </refsect1> | |
91 | ||
92 | <refsect1> | |
93 | <title>Errors</title> | |
94 | ||
95 | <para>Returned errors may indicate the following problems:</para> | |
96 | ||
97 | <variablelist> | |
98 | <varlistentry> | |
99 | <term><constant>-ECHILD</constant></term> | |
100 | ||
101 | <listitem><para>The bus connection has been created in a different process.</para></listitem> | |
102 | </varlistentry> | |
103 | </variablelist> | |
104 | </refsect1> | |
105 | ||
106 | <refsect1> | |
107 | <title>Notes</title> | |
108 | ||
109 | <para><function>sd_bus_set_connected_signal()</function> and <function>sd_bus_get_connected_signal()</function> are available as | |
110 | a shared library, which can be compiled and linked to with the <constant>libsystemd</constant> <citerefentry | |
111 | project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> file.</para> | |
112 | </refsect1> | |
113 | ||
114 | <refsect1> | |
115 | <title>See Also</title> | |
116 | ||
117 | <para> | |
118 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
119 | <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
120 | <citerefentry><refentrytitle>sd_bus_match_signal_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
121 | <citerefentry><refentrytitle>sd_bus_set_watch_bind</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
122 | <citerefentry><refentrytitle>sd_bus_is_ready</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
123 | </para> | |
124 | </refsect1> | |
125 | ||
126 | </refentry> |