Tizen 2.1 base
[platform/upstream/glib2.0.git] / docs / reference / gio / html / GUnixConnection.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>GUnixConnection</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="highlevel-socket.html" title="High-level network functionallity">
9 <link rel="prev" href="GSocketConnection.html" title="GSocketConnection">
10 <link rel="next" href="GTcpConnection.html" title="GTcpConnection">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="GSocketConnection.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="highlevel-socket.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GIO Reference Manual</th>
21 <td><a accesskey="n" href="GTcpConnection.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GUnixConnection.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#GUnixConnection.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#GUnixConnection.object-hierarchy" class="shortcut">Object Hierarchy</a>
29 </td></tr>
30 </table>
31 <div class="refentry">
32 <a name="GUnixConnection"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
34 <td valign="top">
35 <h2><span class="refentrytitle"><a name="GUnixConnection.top_of_page"></a>GUnixConnection</span></h2>
36 <p>GUnixConnection — A UNIX domain GSocketConnection</p>
37 </td>
38 <td valign="top" align="right"></td>
39 </tr></table></div>
40 <div class="refsynopsisdiv">
41 <a name="GUnixConnection.synopsis"></a><h2>Synopsis</h2>
42 <pre class="synopsis">
43 #include &lt;gio/gunixconnection.h&gt;
44
45                     <a class="link" href="GUnixConnection.html#GUnixConnection-struct" title="GUnixConnection">GUnixConnection</a>;
46 <a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="GUnixConnection.html#g-unix-connection-receive-fd" title="g_unix_connection_receive_fd ()">g_unix_connection_receive_fd</a>        (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
47                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
48                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
49 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GUnixConnection.html#g-unix-connection-send-fd" title="g_unix_connection_send_fd ()">g_unix_connection_send_fd</a>           (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
50                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>,
51                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
52                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
53 <a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> *      <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials" title="g_unix_connection_receive_credentials ()">g_unix_connection_receive_credentials</a>
54                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
55                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
56                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
57 <span class="returnvalue">void</span>                <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials-async" title="g_unix_connection_receive_credentials_async ()">g_unix_connection_receive_credentials_async</a>
58                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
59                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
60                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
61                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
62 <a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> *      <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials-finish" title="g_unix_connection_receive_credentials_finish ()">g_unix_connection_receive_credentials_finish</a>
63                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
64                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
65                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
66 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials" title="g_unix_connection_send_credentials ()">g_unix_connection_send_credentials</a>  (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
67                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
68                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
69 <span class="returnvalue">void</span>                <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials-async" title="g_unix_connection_send_credentials_async ()">g_unix_connection_send_credentials_async</a>
70                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
71                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
72                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
73                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
74 <a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials-finish" title="g_unix_connection_send_credentials_finish ()">g_unix_connection_send_credentials_finish</a>
75                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
76                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
77                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
78 </pre>
79 </div>
80 <div class="refsect1">
81 <a name="GUnixConnection.object-hierarchy"></a><h2>Object Hierarchy</h2>
82 <pre class="synopsis">
83   <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
84    +----<a class="link" href="GIOStream.html" title="GIOStream">GIOStream</a>
85          +----<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a>
86                +----GUnixConnection
87 </pre>
88 </div>
89 <div class="refsect1">
90 <a name="GUnixConnection.description"></a><h2>Description</h2>
91 <p>
92 This is the subclass of <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> that is created
93 for UNIX domain sockets.
94 </p>
95 <p>
96 It contains functions to do some of the UNIX socket specific
97 functionality like passing file descriptors.
98 </p>
99 <p>
100 Note that <code class="filename">&lt;gio/gunixconnection.h&gt;</code> belongs to
101 the UNIX-specific GIO interfaces, thus you have to use the
102 <code class="filename">gio-unix-2.0.pc</code> pkg-config file when using it.
103 </p>
104 </div>
105 <div class="refsect1">
106 <a name="GUnixConnection.details"></a><h2>Details</h2>
107 <div class="refsect2">
108 <a name="GUnixConnection-struct"></a><h3>GUnixConnection</h3>
109 <pre class="programlisting">typedef struct _GUnixConnection GUnixConnection;</pre>
110 </div>
111 <hr>
112 <div class="refsect2">
113 <a name="g-unix-connection-receive-fd"></a><h3>g_unix_connection_receive_fd ()</h3>
114 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                g_unix_connection_receive_fd        (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
115                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
116                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
117 <p>
118 Receives a file descriptor from the sending end of the connection.
119 The sending end has to call <a class="link" href="GUnixConnection.html#g-unix-connection-send-fd" title="g_unix_connection_send_fd ()"><code class="function">g_unix_connection_send_fd()</code></a> for this
120 to work.
121 </p>
122 <p>
123 As well as reading the fd this also reads a single byte from the
124 stream, as this is required for fd passing to work on some
125 implementations.
126 </p>
127 <div class="variablelist"><table border="0">
128 <col align="left" valign="top">
129 <tbody>
130 <tr>
131 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
132 <td>a <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>
133 </td>
134 </tr>
135 <tr>
136 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
137 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
138 </td>
139 </tr>
140 <tr>
141 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
142 <td>
143 <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
144 </td>
145 </tr>
146 <tr>
147 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
148 <td>a file descriptor on success, -1 on error.</td>
149 </tr>
150 </tbody>
151 </table></div>
152 <p class="since">Since 2.22</p>
153 </div>
154 <hr>
155 <div class="refsect2">
156 <a name="g-unix-connection-send-fd"></a><h3>g_unix_connection_send_fd ()</h3>
157 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_unix_connection_send_fd           (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
158                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>,
159                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
160                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
161 <p>
162 Passes a file descriptor to the receiving side of the
163 connection. The receiving end has to call <a class="link" href="GUnixConnection.html#g-unix-connection-receive-fd" title="g_unix_connection_receive_fd ()"><code class="function">g_unix_connection_receive_fd()</code></a>
164 to accept the file descriptor.
165 </p>
166 <p>
167 As well as sending the fd this also writes a single byte to the
168 stream, as this is required for fd passing to work on some
169 implementations.
170 </p>
171 <div class="variablelist"><table border="0">
172 <col align="left" valign="top">
173 <tbody>
174 <tr>
175 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
176 <td>a <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>
177 </td>
178 </tr>
179 <tr>
180 <td><p><span class="term"><em class="parameter"><code>fd</code></em> :</span></p></td>
181 <td>a file descriptor</td>
182 </tr>
183 <tr>
184 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
185 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
186 </td>
187 </tr>
188 <tr>
189 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
190 <td>
191 <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
192 </td>
193 </tr>
194 <tr>
195 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
196 <td>a <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.</td>
197 </tr>
198 </tbody>
199 </table></div>
200 <p class="since">Since 2.22</p>
201 </div>
202 <hr>
203 <div class="refsect2">
204 <a name="g-unix-connection-receive-credentials"></a><h3>g_unix_connection_receive_credentials ()</h3>
205 <pre class="programlisting"><a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> *      g_unix_connection_receive_credentials
206                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
207                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
208                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
209 <p>
210 Receives credentials from the sending end of the connection.  The
211 sending end has to call <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials" title="g_unix_connection_send_credentials ()"><code class="function">g_unix_connection_send_credentials()</code></a> (or
212 similar) for this to work.
213 </p>
214 <p>
215 As well as reading the credentials this also reads (and discards) a
216 single byte from the stream, as this is required for credentials
217 passing to work on some implementations.
218 </p>
219 <p>
220 Other ways to exchange credentials with a foreign peer includes the
221 <a class="link" href="GUnixCredentialsMessage.html" title="GUnixCredentialsMessage"><span class="type">GUnixCredentialsMessage</span></a> type and <a class="link" href="GSocket.html#g-socket-get-credentials" title="g_socket_get_credentials ()"><code class="function">g_socket_get_credentials()</code></a> function.
222 </p>
223 <div class="variablelist"><table border="0">
224 <col align="left" valign="top">
225 <tbody>
226 <tr>
227 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
228 <td>A <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>.</td>
229 </tr>
230 <tr>
231 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
232 <td>A <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
233 </td>
234 </tr>
235 <tr>
236 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
237 <td>Return location for error or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
238 </tr>
239 <tr>
240 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
241 <td>Received credentials on success (free with
242 <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>), <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em> is set. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
243 </td>
244 </tr>
245 </tbody>
246 </table></div>
247 <p class="since">Since 2.26</p>
248 </div>
249 <hr>
250 <div class="refsect2">
251 <a name="g-unix-connection-receive-credentials-async"></a><h3>g_unix_connection_receive_credentials_async ()</h3>
252 <pre class="programlisting"><span class="returnvalue">void</span>                g_unix_connection_receive_credentials_async
253                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
254                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
255                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
256                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
257 <p>
258 Asynchronously receive credentials.
259 </p>
260 <p>
261 For more details, see <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials" title="g_unix_connection_receive_credentials ()"><code class="function">g_unix_connection_receive_credentials()</code></a> which is
262 the synchronous version of this call.
263 </p>
264 <p>
265 When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call
266 <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials-finish" title="g_unix_connection_receive_credentials_finish ()"><code class="function">g_unix_connection_receive_credentials_finish()</code></a> to get the result of the operation.
267 </p>
268 <div class="variablelist"><table border="0">
269 <col align="left" valign="top">
270 <tbody>
271 <tr>
272 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
273 <td>A <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>.</td>
274 </tr>
275 <tr>
276 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
277 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
278 </td>
279 </tr>
280 <tr>
281 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
282 <td>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
283 </td>
284 </tr>
285 <tr>
286 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
287 <td>the data to pass to callback function. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
288 </td>
289 </tr>
290 </tbody>
291 </table></div>
292 <p class="since">Since 2.32</p>
293 </div>
294 <hr>
295 <div class="refsect2">
296 <a name="g-unix-connection-receive-credentials-finish"></a><h3>g_unix_connection_receive_credentials_finish ()</h3>
297 <pre class="programlisting"><a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> *      g_unix_connection_receive_credentials_finish
298                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
299                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
300                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
301 <p>
302 Finishes an asynchronous receive credentials operation started with
303 <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials-async" title="g_unix_connection_receive_credentials_async ()"><code class="function">g_unix_connection_receive_credentials_async()</code></a>.
304 </p>
305 <div class="variablelist"><table border="0">
306 <col align="left" valign="top">
307 <tbody>
308 <tr>
309 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
310 <td>A <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>.</td>
311 </tr>
312 <tr>
313 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
314 <td>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
315 </tr>
316 <tr>
317 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
318 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
319 </td>
320 </tr>
321 <tr>
322 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
323 <td>a <a class="link" href="GCredentials.html" title="GCredentials"><span class="type">GCredentials</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
324 Free the returned object with <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
325 </td>
326 </tr>
327 </tbody>
328 </table></div>
329 <p class="since">Since 2.32</p>
330 </div>
331 <hr>
332 <div class="refsect2">
333 <a name="g-unix-connection-send-credentials"></a><h3>g_unix_connection_send_credentials ()</h3>
334 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_unix_connection_send_credentials  (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
335                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
336                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
337 <p>
338 Passes the credentials of the current user the receiving side
339 of the connection. The receiving end has to call
340 <a class="link" href="GUnixConnection.html#g-unix-connection-receive-credentials" title="g_unix_connection_receive_credentials ()"><code class="function">g_unix_connection_receive_credentials()</code></a> (or similar) to accept the
341 credentials.
342 </p>
343 <p>
344 As well as sending the credentials this also writes a single NUL
345 byte to the stream, as this is required for credentials passing to
346 work on some implementations.
347 </p>
348 <p>
349 Other ways to exchange credentials with a foreign peer includes the
350 <a class="link" href="GUnixCredentialsMessage.html" title="GUnixCredentialsMessage"><span class="type">GUnixCredentialsMessage</span></a> type and <a class="link" href="GSocket.html#g-socket-get-credentials" title="g_socket_get_credentials ()"><code class="function">g_socket_get_credentials()</code></a> function.
351 </p>
352 <div class="variablelist"><table border="0">
353 <col align="left" valign="top">
354 <tbody>
355 <tr>
356 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
357 <td>A <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>.</td>
358 </tr>
359 <tr>
360 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
361 <td>A <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
362 </td>
363 </tr>
364 <tr>
365 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
366 <td>Return location for error or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
367 </tr>
368 <tr>
369 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
370 <td>
371 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if <em class="parameter"><code>error</code></em> is set.</td>
372 </tr>
373 </tbody>
374 </table></div>
375 <p class="since">Since 2.26</p>
376 </div>
377 <hr>
378 <div class="refsect2">
379 <a name="g-unix-connection-send-credentials-async"></a><h3>g_unix_connection_send_credentials_async ()</h3>
380 <pre class="programlisting"><span class="returnvalue">void</span>                g_unix_connection_send_credentials_async
381                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
382                                                          <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
383                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
384                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
385 <p>
386 Asynchronously send credentials.
387 </p>
388 <p>
389 For more details, see <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials" title="g_unix_connection_send_credentials ()"><code class="function">g_unix_connection_send_credentials()</code></a> which is
390 the synchronous version of this call.
391 </p>
392 <p>
393 When the operation is finished, <em class="parameter"><code>callback</code></em> will be called. You can then call
394 <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials-finish" title="g_unix_connection_send_credentials_finish ()"><code class="function">g_unix_connection_send_credentials_finish()</code></a> to get the result of the operation.
395 </p>
396 <div class="variablelist"><table border="0">
397 <col align="left" valign="top">
398 <tbody>
399 <tr>
400 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
401 <td>A <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>.</td>
402 </tr>
403 <tr>
404 <td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
405 <td>optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
406 </td>
407 </tr>
408 <tr>
409 <td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
410 <td>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied. <span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span>
411 </td>
412 </tr>
413 <tr>
414 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
415 <td>the data to pass to callback function. <span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span>
416 </td>
417 </tr>
418 </tbody>
419 </table></div>
420 <p class="since">Since 2.32</p>
421 </div>
422 <hr>
423 <div class="refsect2">
424 <a name="g-unix-connection-send-credentials-finish"></a><h3>g_unix_connection_send_credentials_finish ()</h3>
425 <pre class="programlisting"><a href="./../glib/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_unix_connection_send_credentials_finish
426                                                         (<em class="parameter"><code><a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a> *connection</code></em>,
427                                                          <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
428                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
429 <p>
430 Finishes an asynchronous send credentials operation started with
431 <a class="link" href="GUnixConnection.html#g-unix-connection-send-credentials-async" title="g_unix_connection_send_credentials_async ()"><code class="function">g_unix_connection_send_credentials_async()</code></a>.
432 </p>
433 <div class="variablelist"><table border="0">
434 <col align="left" valign="top">
435 <tbody>
436 <tr>
437 <td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
438 <td>A <a class="link" href="GUnixConnection.html" title="GUnixConnection"><span class="type">GUnixConnection</span></a>.</td>
439 </tr>
440 <tr>
441 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
442 <td>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</td>
443 </tr>
444 <tr>
445 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
446 <td>a <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
447 </td>
448 </tr>
449 <tr>
450 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
451 <td>
452 <a href="./../glib/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the operation was successful, otherwise <a href="./../glib/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>.</td>
453 </tr>
454 </tbody>
455 </table></div>
456 <p class="since">Since 2.32</p>
457 </div>
458 </div>
459 <div class="refsect1">
460 <a name="GUnixConnection.see-also"></a><h2>See Also</h2>
461 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>.
462 </div>
463 </div>
464 <div class="footer">
465 <hr>
466           Generated by GTK-Doc V1.18</div>
467 </body>
468 </html>