| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/gtk-doc/html/gio/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GSocketAddress</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="GInetAddress.html" title="GInetAddress">
<link rel="next" href="GInetSocketAddress.html" title="GInetSocketAddress">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="part" href="pt01.html" title="Part I. GIO Overview">
<link rel="chapter" href="ch01.html" title="Introduction">
<link rel="chapter" href="ch02.html" title="Compiling GIO applications">
<link rel="chapter" href="ch03.html" title="Running GIO applications">
<link rel="chapter" href="extending-gio.html" title="Extending GIO">
<link rel="part" href="pt02.html" title="Part II. API Reference">
<link rel="chapter" href="file_ops.html" title="File Operations">
<link rel="chapter" href="file_mon.html" title="File System Monitoring">
<link rel="chapter" href="async.html" title="Asynchronous I/O">
<link rel="chapter" href="streaming.html" title="Streaming I/O">
<link rel="chapter" href="types.html" title="File types and applications">
<link rel="chapter" href="volume_mon.html" title="Volumes and Drives">
<link rel="chapter" href="icons.html" title="Icons">
<link rel="chapter" href="failable_initialization.html" title="Failable Initialization">
<link rel="chapter" href="networking.html" title="Lowlevel platform-independent network support">
<link rel="chapter" href="resolver.html" title="DNS resolution">
<link rel="chapter" href="highlevel-socket.html" title="Highlevel network functionallity">
<link rel="chapter" href="utils.html" title="Utilities">
<link rel="chapter" href="extending.html" title="Extending GIO">
<link rel="part" href="migrating.html" title="Part III. Migrating to GIO">
<link rel="chapter" href="ch18.html" title="Migrating from POSIX to GIO">
<link rel="chapter" href="ch19.html" title="Migrating from GnomeVFS to GIO">
<link rel="chapter" href="gio-hierarchy.html" title="Object Hierarchy">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.18">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.20">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.22">
</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="GInetAddress.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="GInetSocketAddress.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GSocketAddress.synopsis" class="shortcut">Top</a>
|
<a href="#GSocketAddress.description" class="shortcut">Description</a>
|
<a href="#GSocketAddress.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GSocketAddress.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
|
<a href="#GSocketAddress.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="GSocketAddress">
<a name="GSocketAddress"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GSocketAddress.top_of_page"></a>GSocketAddress</span></h2>
<p>GSocketAddress — Abstract base class representing endpoints for
socket communication</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="GSocketAddress.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
<a class="link" href="GSocketAddress.html#GSocketAddress-struct" title="GSocketAddress">GSocketAddress</a>;
enum <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a>;
<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> * <a class="link" href="GSocketAddress.html#g-socket-address-new-from-native" title="g_socket_address_new_from_native ()">g_socket_address_new_from_native</a> (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> native,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"
>gsize</a> len);
<a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> <a class="link" href="GSocketAddress.html#g-socket-address-get-family" title="g_socket_address_get_family ()">g_socket_address_get_family</a> (<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a> <a class="link" href="GSocketAddress.html#g-socket-address-to-native" title="g_socket_address_to_native ()">g_socket_address_to_native</a> (<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> dest,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"
>gsize</a> destlen,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"
>gssize</a> <a class="link" href="GSocketAddress.html#g-socket-address-get-native-size" title="g_socket_address_get_native_size ()">g_socket_address_get_native_size</a> (<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="GSocketAddress.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
<a
href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
+----GSocketAddress
+----<a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress">GInetSocketAddress</a>
+----<a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress">GUnixSocketAddress</a>
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="GSocketAddress.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GSocketAddress implements
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="GSocketAddress.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GSocketAddress.html#GSocketAddress--family" title='The "family" property'>family</a>" <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> : Read
</pre>
</div>
<div class="refsect1" title="Description">
<a name="GSocketAddress.description"></a><h2>Description</h2>
<p>
<a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> is the equivalent of <span class="type">struct sockaddr</span>
in the BSD sockets API. This is an abstract class; use
<a class="link" href="GInetSocketAddress.html" title="GInetSocketAddress"><span class="type">GInetSocketAddress</span></a> for internet sockets, or <a class="link" href="GUnixSocketAddress.html" title="GUnixSocketAddress"><span class="type">GUnixSocketAddress</span></a>
for UNIX domain sockets.</p>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="GSocketAddress.details"></a><h2>Details</h2>
<div class="refsect2" title="GSocketAddress">
<a name="GSocketAddress-struct"></a><h3>GSocketAddress</h3>
<pre class="programlisting">typedef struct _GSocketAddress GSocketAddress;</pre>
<p>
A socket endpoint address, corresponding to <span class="type">struct sockaddr</span>
or one of its subtypes.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="enum GSocketFamily">
<a name="GSocketFamily"></a><h3>enum GSocketFamily</h3>
<pre class="programlisting">typedef enum {
G_SOCKET_FAMILY_INVALID,
#ifdef GLIB_SYSDEF_AF_UNIX
G_SOCKET_FAMILY_UNIX = GLIB_SYSDEF_AF_UNIX,
#endif
G_SOCKET_FAMILY_IPV4 = GLIB_SYSDEF_AF_INET,
G_SOCKET_FAMILY_IPV6 = GLIB_SYSDEF_AF_INET6
} GSocketFamily;
</pre>
<p>
The protocol family of a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a>. (These values are
identical to the system defines <code class="literal">AF_INET</code>, <code class="literal">AF_INET6</code> and <code class="literal">AF_UNIX</code>,
if available.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="G-SOCKET-FAMILY-INVALID--CAPS"></a><span class="term"><code class="literal">G_SOCKET_FAMILY_INVALID</code></span></p></td>
<td> no address family
</td>
</tr>
<tr>
<td><p><a name="G-SOCKET-FAMILY-UNIX--CAPS"></a><span class="term"><code class="literal">G_SOCKET_FAMILY_UNIX</code></span></p></td>
<td> the UNIX domain family
</td>
</tr>
<tr>
<td><p><a name="G-SOCKET-FAMILY-IPV4--CAPS"></a><span class="term"><code class="literal">G_SOCKET_FAMILY_IPV4</code></span></p></td>
<td> the IPv4 family
</td>
</tr>
<tr>
<td><p><a name="G-SOCKET-FAMILY-IPV6--CAPS"></a><span class="term"><code class="literal">G_SOCKET_FAMILY_IPV6</code></span></p></td>
<td> the IPv6 family
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_address_new_from_native ()">
<a name="g-socket-address-new-from-native"></a><h3>g_socket_address_new_from_native ()</h3>
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> * g_socket_address_new_from_native (<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> native,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"
>gsize</a> len);</pre>
<p>
Creates a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> subclass corresponding to the native
<span class="type">struct sockaddr</span> <em class="parameter"><code>native</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>native</code></em> :</span></p></td>
<td> a pointer to a <span class="type">struct sockaddr</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> the size of the memory location pointed to by <em class="parameter"><code>native</code></em>
</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="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> if <em class="parameter"><code>native</code></em> could successfully be converted,
otherwise <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_address_get_family ()">
<a name="g-socket-address-get-family"></a><h3>g_socket_address_get_family ()</h3>
<pre class="programlisting"><a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> g_socket_address_get_family (<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address);</pre>
<p>
Gets the socket family type of <em class="parameter"><code>address</code></em>.</p>
<p>
</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="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the socket family type of <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_socket_address_to_native ()">
<a name="g-socket-address-to-native"></a><h3>g_socket_address_to_native ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
>gboolean</a> g_socket_address_to_native (<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> dest,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"
>gsize</a> destlen,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Converts a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> to a native <span class="type">struct
sockaddr</span>, which can be passed to low-level functions like
<code class="function">connect()</code> or <code class="function">bind()</code>.
</p>
<p>
If not enough space is availible, a <a class="link" href="gio-GIOError.html#G-IO-ERROR-NO-SPACE--CAPS"><code class="literal">G_IO_ERROR_NO_SPACE</code></a> error is
returned. If the address type is not known on the system
then a <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED--CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a> error is returned.</p>
<p>
</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="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td> a pointer to a memory location that will contain the native
<span class="type">struct sockaddr</span>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destlen</code></em> :</span></p></td>
<td> the size of <em class="parameter"><code>dest</code></em>. Must be at least as large as
<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>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> for error reporting, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> to ignore.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE--CAPS"
><code class="literal">TRUE</code></a> if <em class="parameter"><code>dest</code></em> was filled in, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE--CAPS"
><code class="literal">FALSE</code></a> on error
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_address_get_native_size ()">
<a name="g-socket-address-get-native-size"></a><h3>g_socket_address_get_native_size ()</h3>
<pre class="programlisting"><a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"
>gssize</a> g_socket_address_get_native_size (<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address);</pre>
<p>
Gets the size of <em class="parameter"><code>address</code></em>'s native <span class="type">struct sockaddr</span>.
You can use this to allocate memory to pass to
<a class="link" href="GSocketAddress.html#g-socket-address-to-native" title="g_socket_address_to_native ()"><code class="function">g_socket_address_to_native()</code></a>.</p>
<p>
</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="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the size of the native <span class="type">struct sockaddr</span> that
<em class="parameter"><code>address</code></em> represents
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="GSocketAddress.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "family" property'>
<a name="GSocketAddress--family"></a><h3>The <code class="literal">"family"</code> property</h3>
<pre class="programlisting"> "family" <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> : Read</pre>
<p>The family of the socket address.</p>
<p>Default value: G_SOCKET_FAMILY_INVALID</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.11</div>
</body>
</html>