man-pages/man3/sd_bus_set_connected_signal.3.html
2021-03-31 01:06:50 +01:00

151 lines
4.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_SET_CONNECTED_SIGNAL</TITLE>
</HEAD><BODY>
<H1>SD_BUS_SET_CONNECTED_SIGNAL</H1>
Section: sd_bus_set_connected_signal (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_set_connected_signal, sd_bus_get_connected_signal - Control emmission of local connection establishment signal on bus connections
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_bus_set_connected_signal(sd_bus&nbsp;*</B><I>bus</I><B>, int&nbsp;</B><I>b</I><B>);</B>
<DT id="2">
<B>int sd_bus_get_connected_signal(sd_bus&nbsp;*</B><I>bus</I><B>);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>sd_bus_set_connected_signal()</B>
<DD>may be used to control whether a local, synthetic
<B>Connected()</B>
signal message shall be generated and enqueued for dispatching when the connection is fully established. If the
<I>b</I>
parameter is zero the message is not generated (the default), otherwise it is generated.
<P>
<B>sd_bus_get_connected_signal()</B>
may be used to query whether this feature is enabled. It returns zero if not, positive otherwise.
<P>
The
<B>Connected()</B>
signal message is generated from the
&quot;org.freedesktop.DBus.Local&quot;
service and interface, and
&quot;/org/freedesktop/DBus/Local&quot;
object path. Use
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_match_signal_async">sd_bus_match_signal_async</A></B>(3)
to match on this signal.
<P>
This message is particularly useful on slow transports where connections take a long time to be established. This is especially the case when
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_set_watch_bind">sd_bus_set_watch_bind</A></B>(3)
is used. The signal is generated when the
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_is_ready">sd_bus_is_ready</A></B>(3)
returns positive for the first time.
<P>
The
<B>Connected()</B>
signal corresponds with the
<B>Disconnected()</B>
signal that is synthesized locally when the connection is terminated. The latter is generated unconditionally however, unlike the former which needs to be enabled explicitly before it is generated, with
<B>sd_bus_set_connected_signal()</B>.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style error code.
<A NAME="lbAF">&nbsp;</A>
<H3>Errors</H3>
<P>
Returned errors may indicate the following problems:
<P>
<B>-ECHILD</B>
<DL COMPACT><DT id="3"><DD>
The bus connection has been created in a different process.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>NOTES</H2>
<P>
These APIs are implemented as a shared library, which can be compiled and linked to with the
<B>libsystemd</B>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_match_signal_async">sd_bus_match_signal_async</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_set_watch_bind">sd_bus_set_watch_bind</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_is_ready">sd_bus_is_ready</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="7"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DL>
<DT id="8"><A HREF="#lbAF">Errors</A><DD>
</DL>
<DT id="9"><A HREF="#lbAG">NOTES</A><DD>
<DT id="10"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:55 GMT, March 31, 2021
</BODY>
</HTML>