blob: bbf8ab88cff70da7e849202ee462bc777e8a0268 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GUnixSocketAddress</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="networking.html" title="Lowlevel platform-independent network support">
<link rel="prev" href="GInetSocketAddress.html" title="GInetSocketAddress">
<link rel="next" href="GSocketControlMessage.html" title="GSocketControlMessage">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GInetSocketAddress.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="networking.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="GSocketControlMessage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GUnixSocketAddress.synopsis" class="shortcut">Top</a>
 | 
<a href="#GUnixSocketAddress.description" class="shortcut">Description</a>
 | 
<a href="#GUnixSocketAddress.object-hierarchy" class="shortcut">Object Hierarchy</a>
 | 
<a href="#GUnixSocketAddress.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
 | 
<a href="#GUnixSocketAddress.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="GUnixSocketAddress">
<a name="GUnixSocketAddress"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GUnixSocketAddress.top_of_page"></a>GUnixSocketAddress</span></h2>
<p>GUnixSocketAddress — UNIX GSocketAddress</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="GUnixSocketAddress.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"> <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress-struct" title="GUnixSocketAddress">GUnixSocketAddress</a>;
<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new" title="g_unix_socket_address_new ()">g_unix_socket_address_new</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);
<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-abstract" title="g_unix_socket_address_new_abstract ()">g_unix_socket_address_new_abstract</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
<em class="parameter"><code><span class="type">int</span> path_len</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-is-abstract" title="g_unix_socket_address_get_is_abstract ()">g_unix_socket_address_get_is_abstract</a>
(<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
const <span class="returnvalue">char</span> * <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path" title="g_unix_socket_address_get_path ()">g_unix_socket_address_get_path</a> (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path-len" title="g_unix_socket_address_get_path_len ()">g_unix_socket_address_get_path_len</a> (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-abstract-names-supported" title="g_unix_socket_address_abstract_names_supported ()">g_unix_socket_address_abstract_names_supported</a>
(<em class="parameter"><code><span class="type">void</span></code></em>);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="GUnixSocketAddress.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
+----<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a>
+----GUnixSocketAddress
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="GUnixSocketAddress.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GUnixSocketAddress implements
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="GUnixSocketAddress.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--abstract" title='The "abstract" property'>abstract</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write / Construct Only
"<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path" title='The "path" property'>path</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only
"<a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path-as-array" title='The "path-as-array" property'>path-as-array</a>" <a href="/usr/share/gtk-doc/html/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>* : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" title="Description">
<a name="GUnixSocketAddress.description"></a><h2>Description</h2>
<p>
Support for UNIX-domain (aka local) sockets.
</p>
</div>
<div class="refsect1" title="Details">
<a name="GUnixSocketAddress.details"></a><h2>Details</h2>
<div class="refsect2" title="GUnixSocketAddress">
<a name="GUnixSocketAddress-struct"></a><h3>GUnixSocketAddress</h3>
<pre class="programlisting">typedef struct _GUnixSocketAddress GUnixSocketAddress;</pre>
<p>
A UNIX-domain (local) socket address, corresponding to a
<span class="type">struct sockaddr_un</span>.
</p>
</div>
<hr>
<div class="refsect2" title="g_unix_socket_address_new ()">
<a name="g-unix-socket-address-new"></a><h3>g_unix_socket_address_new ()</h3>
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>
Creates a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> for <em class="parameter"><code>path</code></em>.
</p>
<p>
To create abstract socket addresses, on systems that support that,
use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-abstract" title="g_unix_socket_address_new_abstract ()"><code class="function">g_unix_socket_address_new_abstract()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>the socket path
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_unix_socket_address_new_abstract ()">
<a name="g-unix-socket-address-new-abstract"></a><h3>g_unix_socket_address_new_abstract ()</h3>
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * g_unix_socket_address_new_abstract (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
<em class="parameter"><code><span class="type">int</span> path_len</code></em>);</pre>
<p>
Creates a new abstract <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> for <em class="parameter"><code>path</code></em>.
</p>
<p>
Unix domain sockets are generally visible in the filesystem. However, some
systems support abstract socket name which are not visible in the
filesystem and not affected by the filesystem permissions, visibility, etc.
</p>
<p>
Note that not all systems (really only Linux) support abstract
socket names, so if you use them on other systems function calls may
return <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a> errors. You can use
<a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-abstract-names-supported" title="g_unix_socket_address_abstract_names_supported ()"><code class="function">g_unix_socket_address_abstract_names_supported()</code></a> to see if abstract
names are supported.
</p>
<p>
If <em class="parameter"><code>path_len</code></em> is -1 then <em class="parameter"><code>path</code></em> is assumed to be a zero terminated
string (although in general abstract names need not be zero terminated
and can have embedded nuls). All bytes after <em class="parameter"><code>path_len</code></em> up to the max size
of an abstract unix domain name is filled with zero bytes.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>the abstract name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path_len</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>path</code></em>, or -1
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_unix_socket_address_get_is_abstract ()">
<a name="g-unix-socket-address-get-is-abstract"></a><h3>g_unix_socket_address_get_is_abstract ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_socket_address_get_is_abstract
(<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
<p>
Gets <em class="parameter"><code>address</code></em>'s path.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the address is abstract, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_unix_socket_address_get_path ()">
<a name="g-unix-socket-address-get-path"></a><h3>g_unix_socket_address_get_path ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> * g_unix_socket_address_get_path (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
<p>
Gets <em class="parameter"><code>address</code></em>'s path, or for abstract sockets the "name".
</p>
<p>
Guaranteed to be zero-terminated, but an abstract socket
may contain embedded zeros, and thus you should use
<a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path-len" title="g_unix_socket_address_get_path_len ()"><code class="function">g_unix_socket_address_get_path_len()</code></a> to get the true length
of this string.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the path for <em class="parameter"><code>address</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_unix_socket_address_get_path_len ()">
<a name="g-unix-socket-address-get-path-len"></a><h3>g_unix_socket_address_get_path_len ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> g_unix_socket_address_get_path_len (<em class="parameter"><code><a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> *address</code></em>);</pre>
<p>
Gets the length of <em class="parameter"><code>address</code></em>'s path.
</p>
<p>
For details, see <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-path" title="g_unix_socket_address_get_path ()"><code class="function">g_unix_socket_address_get_path()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>address</code></em> :</span></p></td>
<td>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the length of the path
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_unix_socket_address_abstract_names_supported ()">
<a name="g-unix-socket-address-abstract-names-supported"></a><h3>g_unix_socket_address_abstract_names_supported ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> g_unix_socket_address_abstract_names_supported
(<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Checks if abstract unix domain socket names are supported.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if supported, <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="GUnixSocketAddress.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "abstract" property'>
<a name="GUnixSocketAddress--abstract"></a><h3>The <code class="literal">"abstract"</code> property</h3>
<pre class="programlisting"> "abstract" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read / Write / Construct Only</pre>
<p>Whether or not this is an abstract address.</p>
<p>Default value: FALSE</p>
</div>
<hr>
<div class="refsect2" title='The "path" property'>
<a name="GUnixSocketAddress--path"></a><h3>The <code class="literal">"path"</code> property</h3>
<pre class="programlisting"> "path" <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre>
<p>UNIX socket path.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" title='The "path-as-array" property'>
<a name="GUnixSocketAddress--path-as-array"></a><h3>The <code class="literal">"path-as-array"</code> property</h3>
<pre class="programlisting"> "path-as-array" <a href="/usr/share/gtk-doc/html/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>* : Read / Write / Construct Only</pre>
<p>UNIX socket path, as byte array.</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.14</div>
</body>
</html>