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