| <!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: GIO Reference Manual</title> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> |
| <link rel="home" href="index.html" title="GIO Reference Manual"> |
| <link rel="up" href="networking.html" title="Low-level 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.25.1 (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="5"><tr valign="middle"> |
| <td width="100%" align="left" class="shortcuts"> |
| <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> |
| <a href="#GUnixSocketAddress.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> |
| <a href="#GUnixSocketAddress.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces"> <span class="dim">|</span> |
| <a href="#GUnixSocketAddress.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties"> <span class="dim">|</span> |
| <a href="#GUnixSocketAddress.properties" class="shortcut">Properties</a></span> |
| </td> |
| <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> |
| <td><a accesskey="u" href="networking.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| <td><a accesskey="p" href="GInetSocketAddress.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> |
| <td><a accesskey="n" href="GSocketControlMessage.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> |
| </tr></table> |
| <div class="refentry"> |
| <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 class="gallery_image" valign="top" align="right"></td> |
| </tr></table></div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.functions"></a><h2>Functions</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="functions_return"> |
| <col class="functions_name"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new" title="g_unix_socket_address_new ()">g_unix_socket_address_new</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-with-type" title="g_unix_socket_address_new_with_type ()">g_unix_socket_address_new_with_type</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="returnvalue">GUnixSocketAddressType</span></a> |
| </td> |
| <td class="function_name"> |
| <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-address-type" title="g_unix_socket_address_get_address_type ()">g_unix_socket_address_get_address_type</a> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type">const <span class="returnvalue">char</span> * |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gsize"><span class="returnvalue">gsize</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| <tr> |
| <td class="function_type"> |
| <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> |
| </td> |
| <td class="function_name"> |
| <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> <span class="c_punctuation">()</span> |
| </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.properties"></a><h2>Properties</h2> |
| <div class="informaltable"><table class="informaltable" border="0"> |
| <colgroup> |
| <col width="150px" class="properties_type"> |
| <col width="300px" class="properties_name"> |
| <col width="200px" class="properties_flags"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> |
| <td class="property_name"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--abstract" title="The “abstract” property">abstract</a></td> |
| <td class="property_flags">Read / Write / Construct Only</td> |
| </tr> |
| <tr> |
| <td class="property_type"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a></td> |
| <td class="property_name"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--address-type" title="The “address-type” property">address-type</a></td> |
| <td class="property_flags">Read / Write / Construct Only</td> |
| </tr> |
| <tr> |
| <td class="property_type"> |
| <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td> |
| <td class="property_name"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path" title="The “path” property">path</a></td> |
| <td class="property_flags">Read / Write / Construct Only</td> |
| </tr> |
| <tr> |
| <td class="property_type"> |
| <a href="../glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *</td> |
| <td class="property_name"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--path-as-array" title="The “path-as-array” property">path-as-array</a></td> |
| <td class="property_flags">Read / Write / Construct Only</td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.other"></a><h2>Types and Values</h2> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="name"> |
| <col class="description"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="datatype_keyword">struct</td> |
| <td class="function_name"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress-struct" title="struct GUnixSocketAddress">GUnixSocketAddress</a></td> |
| </tr> |
| <tr> |
| <td class="datatype_keyword">enum</td> |
| <td class="function_name"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType">GUnixSocketAddressType</a></td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.object-hierarchy"></a><h2>Object Hierarchy</h2> |
| <pre class="screen"> <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> |
| <span class="lineart">╰──</span> <a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> |
| <span class="lineart">╰──</span> GUnixSocketAddress |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <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"> |
| <a name="GUnixSocketAddress.includes"></a><h2>Includes</h2> |
| <pre class="synopsis">#include <gio/gunixsocketaddress.h> |
| </pre> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.description"></a><h2>Description</h2> |
| <p>Support for UNIX-domain (also known as local) sockets.</p> |
| <p>UNIX domain sockets are generally visible in the filesystem. |
| However, some systems support abstract socket names which are not |
| visible in the filesystem and not affected by the filesystem |
| permissions, visibility, etc. Currently this is only supported |
| under Linux. If you attempt to use abstract sockets 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>Note that <code class="literal"><gio/gunixsocketaddress.h></code> belongs to the UNIX-specific GIO |
| interfaces, thus you have to use the <code class="literal">gio-unix-2.0.pc</code> pkg-config file |
| when using it.</p> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.functions_details"></a><h2>Functions</h2> |
| <div class="refsect2"> |
| <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="../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="refsect3"> |
| <a name="g-unix-socket-address-new.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>path</p></td> |
| <td class="parameter_description"><p>the socket path</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-new.returns"></a><h4>Returns</h4> |
| <p> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> path_len</code></em>);</pre> |
| <div class="warning"> |
| <p><code class="literal">g_unix_socket_address_new_abstract</code> is deprecated and should not be used in newly-written code.</p> |
| <p>Use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new-with-type" title="g_unix_socket_address_new_with_type ()"><code class="function">g_unix_socket_address_new_with_type()</code></a>.</p> |
| </div> |
| <p>Creates a new <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a> |
| <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> for <em class="parameter"><code>path</code></em> |
| .</p> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-new-abstract.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>path</p></td> |
| <td class="parameter_description"><p> the abstract name. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=path_len][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> gchar]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>path_len</p></td> |
| <td class="parameter_description"><p>the length of <em class="parameter"><code>path</code></em> |
| , or -1</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-new-abstract.returns"></a><h4>Returns</h4> |
| <p> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a></p> |
| </div> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-unix-socket-address-new-with-type"></a><h3>g_unix_socket_address_new_with_type ()</h3> |
| <pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> * |
| g_unix_socket_address_new_with_type (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>, |
| <em class="parameter"><code><a href="../glib-Basic-Types.html#gint"><span class="type">gint</span></a> path_len</code></em>, |
| <em class="parameter"><code><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a> type</code></em>);</pre> |
| <p>Creates a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a> of type <em class="parameter"><code>type</code></em> |
| with name <em class="parameter"><code>path</code></em> |
| .</p> |
| <p>If <em class="parameter"><code>type</code></em> |
| is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-PATH:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_PATH</code></a>, this is equivalent to |
| calling <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-new" title="g_unix_socket_address_new ()"><code class="function">g_unix_socket_address_new()</code></a>.</p> |
| <p>If <em class="parameter"><code>type</code></em> |
| is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ANONYMOUS:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ANONYMOUS</code></a>, <em class="parameter"><code>path</code></em> |
| and <em class="parameter"><code>path_len</code></em> |
| will be |
| ignored.</p> |
| <p>If <em class="parameter"><code>path_type</code></em> |
| is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></a>, then <em class="parameter"><code>path_len</code></em> |
| |
| bytes of <em class="parameter"><code>path</code></em> |
| will be copied to the socket's path, and only those |
| bytes will be considered part of the name. (If <em class="parameter"><code>path_len</code></em> |
| is -1, |
| then <em class="parameter"><code>path</code></em> |
| is assumed to be NUL-terminated.) For example, if <em class="parameter"><code>path</code></em> |
| |
| was "test", then calling <a class="link" href="GSocketAddress.html#g-socket-address-get-native-size" title="g_socket_address_get_native_size ()"><code class="function">g_socket_address_get_native_size()</code></a> on the |
| returned socket would return 7 (2 bytes of overhead, 1 byte for the |
| abstract-socket indicator byte, and 4 bytes for the name "test").</p> |
| <p>If <em class="parameter"><code>path_type</code></em> |
| is <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a>, then |
| <em class="parameter"><code>path_len</code></em> |
| bytes of <em class="parameter"><code>path</code></em> |
| will be copied to the socket's path, the |
| rest of the path will be padded with 0 bytes, and the entire |
| zero-padded buffer will be considered the name. (As above, if |
| <em class="parameter"><code>path_len</code></em> |
| is -1, then <em class="parameter"><code>path</code></em> |
| is assumed to be NUL-terminated.) In |
| this case, <a class="link" href="GSocketAddress.html#g-socket-address-get-native-size" title="g_socket_address_get_native_size ()"><code class="function">g_socket_address_get_native_size()</code></a> will always return |
| the full size of a <code class="literal">struct sockaddr_un</code>, although |
| <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> will still return just the |
| length of <em class="parameter"><code>path</code></em> |
| .</p> |
| <p><a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></a> is preferred over |
| <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a> for new programs. Of course, |
| when connecting to a server created by another process, you must |
| use the appropriate type corresponding to how that process created |
| its listening socket.</p> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-new-with-type.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="parameter_name"><p>path</p></td> |
| <td class="parameter_description"><p> the name. </p></td> |
| <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=path_len][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> gchar]</span></td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>path_len</p></td> |
| <td class="parameter_description"><p>the length of <em class="parameter"><code>path</code></em> |
| , or -1</p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="parameter_name"><p>type</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-new-with-type.returns"></a><h4>Returns</h4> |
| <p> a new <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-unix-socket-address-get-is-abstract"></a><h3>g_unix_socket_address_get_is_abstract ()</h3> |
| <pre class="programlisting"><a href="../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> |
| <div class="warning"> |
| <p><code class="literal">g_unix_socket_address_get_is_abstract</code> is deprecated and should not be used in newly-written code.</p> |
| <p>Use <a class="link" href="GUnixSocketAddress.html#g-unix-socket-address-get-address-type" title="g_unix_socket_address_get_address_type ()"><code class="function">g_unix_socket_address_get_address_type()</code></a></p> |
| </div> |
| <p>Tests if <em class="parameter"><code>address</code></em> |
| is abstract.</p> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-get-is-abstract.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>address</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-get-is-abstract.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the address is abstract, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-unix-socket-address-get-address-type"></a><h3>g_unix_socket_address_get_address_type ()</h3> |
| <pre class="programlisting"><a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="returnvalue">GUnixSocketAddressType</span></a> |
| g_unix_socket_address_get_address_type |
| (<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 type.</p> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-get-address-type.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>address</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-get-address-type.returns"></a><h4>Returns</h4> |
| <p> a <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a></p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="refsect3"> |
| <a name="g-unix-socket-address-get-path.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>address</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-get-path.returns"></a><h4>Returns</h4> |
| <p> the path for <em class="parameter"><code>address</code></em> |
| </p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-unix-socket-address-get-path-len"></a><h3>g_unix_socket_address_get_path_len ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-unix-socket-address-get-path-len.parameters"></a><h4>Parameters</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="150px" class="parameters_name"> |
| <col class="parameters_description"> |
| <col width="200px" class="parameters_annotations"> |
| </colgroup> |
| <tbody><tr> |
| <td class="parameter_name"><p>address</p></td> |
| <td class="parameter_description"><p>a <a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a></p></td> |
| <td class="parameter_annotations"> </td> |
| </tr></tbody> |
| </table></div> |
| </div> |
| <div class="refsect3"> |
| <a name="g-unix-socket-address-get-path-len.returns"></a><h4>Returns</h4> |
| <p> the length of the path</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="g-unix-socket-address-abstract-names-supported"></a><h3>g_unix_socket_address_abstract_names_supported ()</h3> |
| <pre class="programlisting"><a href="../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="refsect3"> |
| <a name="g-unix-socket-address-abstract-names-supported.returns"></a><h4>Returns</h4> |
| <p> <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if supported, <a href="../glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.other_details"></a><h2>Types and Values</h2> |
| <div class="refsect2"> |
| <a name="GUnixSocketAddress-struct"></a><h3>struct GUnixSocketAddress</h3> |
| <pre class="programlisting">struct GUnixSocketAddress;</pre> |
| <p>A UNIX-domain (local) socket address, corresponding to a |
| struct sockaddr_un.</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GUnixSocketAddressType"></a><h3>enum GUnixSocketAddressType</h3> |
| <p>The type of name used by a <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>. |
| <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-PATH:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_PATH</code></a> indicates a traditional unix domain |
| socket bound to a filesystem path. <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ANONYMOUS:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ANONYMOUS</code></a> |
| indicates a socket not bound to any name (eg, a client-side socket, |
| or a socket created with <code class="function">socketpair()</code>).</p> |
| <p>For abstract sockets, there are two incompatible ways of naming |
| them; the man pages suggest using the entire <code class="literal">struct sockaddr_un</code> |
| as the name, padding the unused parts of the <code class="literal">sun_path</code> field with |
| zeroes; this corresponds to <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</code></a>. |
| However, many programs instead just use a portion of <code class="literal">sun_path</code>, and |
| pass an appropriate smaller length to <code class="function">bind()</code> or <code class="function">connect()</code>. This is |
| <a class="link" href="GUnixSocketAddress.html#G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"><code class="literal">G_UNIX_SOCKET_ADDRESS_ABSTRACT</code></a>.</p> |
| <div class="refsect3"> |
| <a name="GUnixSocketAddressType.members"></a><h4>Members</h4> |
| <div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| <colgroup> |
| <col width="300px" class="enum_members_name"> |
| <col class="enum_members_description"> |
| <col width="200px" class="enum_members_annotations"> |
| </colgroup> |
| <tbody> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-UNIX-SOCKET-ADDRESS-INVALID:CAPS"></a>G_UNIX_SOCKET_ADDRESS_INVALID</p></td> |
| <td class="enum_member_description"> |
| <p>invalid</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-UNIX-SOCKET-ADDRESS-ANONYMOUS:CAPS"></a>G_UNIX_SOCKET_ADDRESS_ANONYMOUS</p></td> |
| <td class="enum_member_description"> |
| <p>anonymous</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-UNIX-SOCKET-ADDRESS-PATH:CAPS"></a>G_UNIX_SOCKET_ADDRESS_PATH</p></td> |
| <td class="enum_member_description"> |
| <p>a filesystem path</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-UNIX-SOCKET-ADDRESS-ABSTRACT:CAPS"></a>G_UNIX_SOCKET_ADDRESS_ABSTRACT</p></td> |
| <td class="enum_member_description"> |
| <p>an abstract name</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| <tr> |
| <td class="enum_member_name"><p><a name="G-UNIX-SOCKET-ADDRESS-ABSTRACT-PADDED:CAPS"></a>G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED</p></td> |
| <td class="enum_member_description"> |
| <p>an abstract name, 0-padded |
| to the full length of a unix socket name</p> |
| </td> |
| <td class="enum_member_annotations"> </td> |
| </tr> |
| </tbody> |
| </table></div> |
| </div> |
| <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> |
| </div> |
| </div> |
| <div class="refsect1"> |
| <a name="GUnixSocketAddress.property-details"></a><h2>Property Details</h2> |
| <div class="refsect2"> |
| <a name="GUnixSocketAddress--abstract"></a><h3>The <code class="literal">“abstract”</code> property</h3> |
| <pre class="programlisting"> “abstract” <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> |
| <p>Whether or not this is an abstract address</p> |
| <div class="warning"> |
| <p><code class="literal">GUnixSocketAddress:abstract</code> is deprecated and should not be used in newly-written code.</p> |
| <p>Use <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddress--address-type" title="The “address-type” property"><span class="type">“address-type”</span></a>, which |
| distinguishes between zero-padded and non-zero-padded |
| abstract addresses.</p> |
| </div> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p>Default value: FALSE</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GUnixSocketAddress--address-type"></a><h3>The <code class="literal">“address-type”</code> property</h3> |
| <pre class="programlisting"> “address-type” <a class="link" href="GUnixSocketAddress.html#GUnixSocketAddressType" title="enum GUnixSocketAddressType"><span class="type">GUnixSocketAddressType</span></a></pre> |
| <p>The type of UNIX socket address.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p>Default value: G_UNIX_SOCKET_ADDRESS_PATH</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <a name="GUnixSocketAddress--path"></a><h3>The <code class="literal">“path”</code> property</h3> |
| <pre class="programlisting"> “path” <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre> |
| <p>UNIX socket path.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| <p>Default value: NULL</p> |
| </div> |
| <hr> |
| <div class="refsect2"> |
| <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="../glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a> *</pre> |
| <p>UNIX socket path, as byte array.</p> |
| <p>Flags: Read / Write / Construct Only</p> |
| </div> |
| </div> |
| </div> |
| <div class="footer"> |
| <hr>Generated by GTK-Doc V1.25.1</div> |
| </body> |
| </html> |