<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SoupAddress</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="index.html" title="libsoup Reference Manual">
<link rel="up" href="ch05.html" title="Low-level Networking API">
<link rel="prev" href="ch05.html" title="Low-level Networking API">
<link rel="next" href="SoupSocket.html" title="SoupSocket">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Tutorial">
<link rel="chapter" href="ch02.html" title="Core API">
<link rel="chapter" href="ch03.html" title="Web Services APIs">
<link rel="chapter" href="ch04.html" title="GNOME integration">
<link rel="chapter" href="ch05.html" title="Low-level Networking API">
<link rel="index" href="ix01.html" title="Index">
</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="ch05.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch05.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">libsoup Reference Manual</th>
<td><a accesskey="n" href="SoupSocket.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#SoupAddress.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#SoupAddress.description" class="shortcut">Description</a>
                 | 
                <a href="#SoupAddress.object-hierarchy" class="shortcut">Object Hierarchy</a>
                 | 
                <a href="#SoupAddress.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="SoupAddress"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="SoupAddress.top_of_page"></a>SoupAddress</span></h2>
<p>SoupAddress — DNS support</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="SoupAddress.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
                    <a class="link" href="SoupAddress.html#SoupAddress-struct" title="SoupAddress">SoupAddress</a>;
enum                <a class="link" href="SoupAddress.html#SoupAddressFamily" title="enum SoupAddressFamily">SoupAddressFamily</a>;
#define             <a class="link" href="SoupAddress.html#SOUP-ADDRESS-ANY-PORT--CAPS" title="SOUP_ADDRESS_ANY_PORT">SOUP_ADDRESS_ANY_PORT</a>
<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *       <a class="link" href="SoupAddress.html#soup-address-new" title="soup_address_new ()">soup_address_new</a>                    (const char *name,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> port);
<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *       <a class="link" href="SoupAddress.html#soup-address-new-from-sockaddr" title="soup_address_new_from_sockaddr ()">soup_address_new_from_sockaddr</a>      (struct sockaddr *sa,
                                                         int len);
<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *       <a class="link" href="SoupAddress.html#soup-address-new-any" title="soup_address_new_any ()">soup_address_new_any</a>                (<a class="link" href="SoupAddress.html#SoupAddressFamily" title="enum SoupAddressFamily">SoupAddressFamily</a> family,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> port);

void                (<a class="link" href="SoupAddress.html#SoupAddressCallback" title="SoupAddressCallback ()">*SoupAddressCallback</a>)              (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> status,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
void                <a class="link" href="SoupAddress.html#soup-address-resolve-async" title="soup_address_resolve_async ()">soup_address_resolve_async</a>          (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext"
>GMainContext</a> *async_context,
                                                         <a
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
>GCancellable</a> *cancellable,
                                                         <a class="link" href="SoupAddress.html#SoupAddressCallback" title="SoupAddressCallback ()">SoupAddressCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="SoupAddress.html#soup-address-resolve-sync" title="soup_address_resolve_sync ()">soup_address_resolve_sync</a>           (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         <a
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
>GCancellable</a> *cancellable);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="SoupAddress.html#soup-address-is-resolved" title="soup_address_is_resolved ()">soup_address_is_resolved</a>            (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);

const char *        <a class="link" href="SoupAddress.html#soup-address-get-name" title="soup_address_get_name ()">soup_address_get_name</a>               (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
struct sockaddr *   <a class="link" href="SoupAddress.html#soup-address-get-sockaddr" title="soup_address_get_sockaddr ()">soup_address_get_sockaddr</a>           (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         int *len);
const char *        <a class="link" href="SoupAddress.html#soup-address-get-physical" title="soup_address_get_physical ()">soup_address_get_physical</a>           (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="SoupAddress.html#soup-address-get-port" title="soup_address_get_port ()">soup_address_get_port</a>               (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);

<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()">soup_address_equal_by_name</a>          (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr1,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr2);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="SoupAddress.html#soup-address-hash-by-name" title="soup_address_hash_by_name ()">soup_address_hash_by_name</a>           (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            <a class="link" href="SoupAddress.html#soup-address-equal-by-ip" title="soup_address_equal_by_ip ()">soup_address_equal_by_ip</a>            (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr1,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr2);
<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               <a class="link" href="SoupAddress.html#soup-address-hash-by-ip" title="soup_address_hash_by_ip ()">soup_address_hash_by_ip</a>             (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr);

#define             <a class="link" href="SoupAddress.html#SOUP-ADDRESS-FAMILY--CAPS" title="SOUP_ADDRESS_FAMILY">SOUP_ADDRESS_FAMILY</a>
#define             <a class="link" href="SoupAddress.html#SOUP-ADDRESS-NAME--CAPS" title="SOUP_ADDRESS_NAME">SOUP_ADDRESS_NAME</a>
#define             <a class="link" href="SoupAddress.html#SOUP-ADDRESS-PHYSICAL--CAPS" title="SOUP_ADDRESS_PHYSICAL">SOUP_ADDRESS_PHYSICAL</a>
#define             <a class="link" href="SoupAddress.html#SOUP-ADDRESS-PORT--CAPS" title="SOUP_ADDRESS_PORT">SOUP_ADDRESS_PORT</a>
#define             <a class="link" href="SoupAddress.html#SOUP-ADDRESS-SOCKADDR--CAPS" title="SOUP_ADDRESS_SOCKADDR">SOUP_ADDRESS_SOCKADDR</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="SoupAddress.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>
   +----SoupAddress
</pre>
</div>
<div class="refsect1" lang="en">
<a name="SoupAddress.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="SoupAddress.html#SoupAddress--family" title='The "family" property'>family</a>"                   <a class="link" href="SoupAddress.html#SoupAddressFamily" title="enum SoupAddressFamily">SoupAddressFamily</a>     : Read / Write / Construct Only
  "<a class="link" href="SoupAddress.html#SoupAddress--name" title='The "name" property'>name</a>"                     <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*                : Read / Write / Construct Only
  "<a class="link" href="SoupAddress.html#SoupAddress--physical" title='The "physical" property'>physical</a>"                 <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*                : Read
  "<a class="link" href="SoupAddress.html#SoupAddress--port" title='The "port" property'>port</a>"                     <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only
  "<a class="link" href="SoupAddress.html#SoupAddress--sockaddr" title='The "sockaddr" property'>sockaddr</a>"                 <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a>              : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1" lang="en">
<a name="SoupAddress.description"></a><h2>Description</h2>
<p>
<a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> represents the address of a TCP connection endpoint:
both the IP address and the port. (It is somewhat like an
object-oriented version of struct sockaddr.)
</p>
<p>
If libsoup was built with IPv6 support, <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> will allow
both IPv4 and IPv6 addresses.</p>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="SoupAddress.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="SoupAddress-struct"></a><h3>SoupAddress</h3>
<pre class="programlisting">typedef struct _SoupAddress SoupAddress;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SoupAddressFamily"></a><h3>enum SoupAddressFamily</h3>
<pre class="programlisting">typedef enum {
	SOUP_ADDRESS_FAMILY_INVALID = -1,

	SOUP_ADDRESS_FAMILY_IPV4 = AF_INET,
	SOUP_ADDRESS_FAMILY_IPV6 = AF_INET6
} SoupAddressFamily;
</pre>
<p>
The supported address families. Note that the
<a class="link" href="SoupAddress.html#SOUP-ADDRESS-FAMILY-IPV6--CAPS"><code class="literal">SOUP_ADDRESS_FAMILY_IPV6</code></a> constant is available even if libsoup was
built without IPv6 support, but attempting to create an IPv6
address will fail in that case.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="SOUP-ADDRESS-FAMILY-INVALID--CAPS"></a><span class="term"><code class="literal">SOUP_ADDRESS_FAMILY_INVALID</code></span></p></td>
<td> an invalid <a class="link" href="SoupAddress.html" title="SoupAddress"><code class="literal">SoupAddress</code></a>
</td>
</tr>
<tr>
<td><p><a name="SOUP-ADDRESS-FAMILY-IPV4--CAPS"></a><span class="term"><code class="literal">SOUP_ADDRESS_FAMILY_IPV4</code></span></p></td>
<td> an IPv4 address
</td>
</tr>
<tr>
<td><p><a name="SOUP-ADDRESS-FAMILY-IPV6--CAPS"></a><span class="term"><code class="literal">SOUP_ADDRESS_FAMILY_IPV6</code></span></p></td>
<td> an IPv6 address
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SOUP-ADDRESS-ANY-PORT--CAPS"></a><h3>SOUP_ADDRESS_ANY_PORT</h3>
<pre class="programlisting">#define SOUP_ADDRESS_ANY_PORT 0
</pre>
<p>
This can be passed to any <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> method that expects a port,
to indicate that you don't care what port is used.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-new"></a><h3>soup_address_new ()</h3>
<pre class="programlisting"><a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *       soup_address_new                    (const char *name,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> port);</pre>
<p>
Creates a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> from <em class="parameter"><code>name</code></em> and <em class="parameter"><code>port</code></em>. The <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>'s IP
address may not be available right away; the caller can call
<a class="link" href="SoupAddress.html#soup-address-resolve-async" title="soup_address_resolve_async ()"><code class="function">soup_address_resolve_async()</code></a> or <a class="link" href="SoupAddress.html#soup-address-resolve-sync" title="soup_address_resolve_sync ()"><code class="function">soup_address_resolve_sync()</code></a> to
force a DNS resolution.</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>name</code></em> :</span></p></td>
<td> a hostname or physical address
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
<td> a port number
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-new-from-sockaddr"></a><h3>soup_address_new_from_sockaddr ()</h3>
<pre class="programlisting"><a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *       soup_address_new_from_sockaddr      (struct sockaddr *sa,
                                                         int len);</pre>
<p>
Returns a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> equivalent to <em class="parameter"><code>sa</code></em> (or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if <em class="parameter"><code>sa</code></em>'s
address family isn't supported)</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>sa</code></em> :</span></p></td>
<td> a pointer to a sockaddr
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> size of <em class="parameter"><code>sa</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the new <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-new-any"></a><h3>soup_address_new_any ()</h3>
<pre class="programlisting"><a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *       soup_address_new_any                (<a class="link" href="SoupAddress.html#SoupAddressFamily" title="enum SoupAddressFamily">SoupAddressFamily</a> family,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> port);</pre>
<p>
Returns a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> corresponding to the "any" address
for <em class="parameter"><code>family</code></em> (or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if <em class="parameter"><code>family</code></em> isn't supported), suitable for
passing to <code class="function">soup_socket_server_new()</code>.</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>family</code></em> :</span></p></td>
<td> the address family
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>port</code></em> :</span></p></td>
<td> the port number (usually <a class="link" href="SoupAddress.html#SOUP-ADDRESS-ANY-PORT--CAPS" title="SOUP_ADDRESS_ANY_PORT"><code class="literal">SOUP_ADDRESS_ANY_PORT</code></a>)
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the new <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SoupAddressCallback"></a><h3>SoupAddressCallback ()</h3>
<pre class="programlisting">void                (*SoupAddressCallback)              (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a> status,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<p>
The callback function passed to <a class="link" href="SoupAddress.html#soup-address-resolve-async" title="soup_address_resolve_async ()"><code class="function">soup_address_resolve_async()</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>addr</code></em> :</span></p></td>
<td> the <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> that was resolved
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
<td> <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-OK--CAPS"><code class="literal">SOUP_STATUS_OK</code></a>, <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANT-RESOLVE--CAPS"><code class="literal">SOUP_STATUS_CANT_RESOLVE</code></a>, or
<a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANCELLED--CAPS"><code class="literal">SOUP_STATUS_CANCELLED</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td> the user data that was passed to
<a class="link" href="SoupAddress.html#soup-address-resolve-async" title="soup_address_resolve_async ()"><code class="function">soup_address_resolve_async()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-resolve-async"></a><h3>soup_address_resolve_async ()</h3>
<pre class="programlisting">void                soup_address_resolve_async          (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext"
>GMainContext</a> *async_context,
                                                         <a
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
>GCancellable</a> *cancellable,
                                                         <a class="link" href="SoupAddress.html#SoupAddressCallback" title="SoupAddressCallback ()">SoupAddressCallback</a> callback,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
Asynchronously resolves the missing half of <em class="parameter"><code>addr</code></em> (its IP address
if it was created with <a class="link" href="SoupAddress.html#soup-address-new" title="soup_address_new ()"><code class="function">soup_address_new()</code></a>, or its hostname if it
was created with <a class="link" href="SoupAddress.html#soup-address-new-from-sockaddr" title="soup_address_new_from_sockaddr ()"><code class="function">soup_address_new_from_sockaddr()</code></a> or
<a class="link" href="SoupAddress.html#soup-address-new-any" title="soup_address_new_any ()"><code class="function">soup_address_new_any()</code></a>.)
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is non-<a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>, it can be used to cancel the
resolution. <em class="parameter"><code>callback</code></em> will still be invoked in this case, with a
status of <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANCELLED--CAPS"><code class="literal">SOUP_STATUS_CANCELLED</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>async_context</code></em> :</span></p></td>
<td> the <a
href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html#GMainContext"
><span class="type">GMainContext</span></a> to call <em class="parameter"><code>callback</code></em> from
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
><span class="type">GCancellable</span></a> object, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td> callback to call with the result
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> data for <em class="parameter"><code>callback</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-resolve-sync"></a><h3>soup_address_resolve_sync ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               soup_address_resolve_sync           (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         <a
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
>GCancellable</a> *cancellable);</pre>
<p>
Synchronously resolves the missing half of <em class="parameter"><code>addr</code></em>, as with
<a class="link" href="SoupAddress.html#soup-address-resolve-async" title="soup_address_resolve_async ()"><code class="function">soup_address_resolve_async()</code></a>.
</p>
<p>
If <em class="parameter"><code>cancellable</code></em> is non-<a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>, it can be used to cancel the
resolution. <a class="link" href="SoupAddress.html#soup-address-resolve-sync" title="soup_address_resolve_sync ()"><code class="function">soup_address_resolve_sync()</code></a> will then return a status
of <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANCELLED--CAPS"><code class="literal">SOUP_STATUS_CANCELLED</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a
href="/usr/share/gtk-doc/html/gio/GCancellable.html"
><span class="type">GCancellable</span></a> object, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-OK--CAPS"><code class="literal">SOUP_STATUS_OK</code></a>, <a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANT-RESOLVE--CAPS"><code class="literal">SOUP_STATUS_CANT_RESOLVE</code></a>, or
<a class="link" href="libsoup-24-soup-status.html#SOUP-STATUS-CANCELLED--CAPS"><code class="literal">SOUP_STATUS_CANCELLED</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-is-resolved"></a><h3>soup_address_is_resolved ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            soup_address_is_resolved            (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);</pre>
<p>
Tests if <em class="parameter"><code>addr</code></em> has already been resolved.</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</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 <em class="parameter"><code>addr</code></em> has been resolved.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-get-name"></a><h3>soup_address_get_name ()</h3>
<pre class="programlisting">const char *        soup_address_get_name               (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);</pre>
<p>
Returns the hostname associated with <em class="parameter"><code>addr</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the hostname, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> if it is not known.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-get-sockaddr"></a><h3>soup_address_get_sockaddr ()</h3>
<pre class="programlisting">struct sockaddr *   soup_address_get_sockaddr           (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr,
                                                         int *len);</pre>
<p>
Returns the sockaddr associated with <em class="parameter"><code>addr</code></em>, with its length in
*<em class="parameter"><code>len</code></em>. If the sockaddr is not yet known, returns <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
<td> return location for sockaddr length
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the sockaddr, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-get-physical"></a><h3>soup_address_get_physical ()</h3>
<pre class="programlisting">const char *        soup_address_get_physical           (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);</pre>
<p>
Returns the physical address associated with <em class="parameter"><code>addr</code></em> as a string.
(Eg, "127.0.0.1"). If the address is not yet known, returns <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the physical address, or <a
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-get-port"></a><h3>soup_address_get_port ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               soup_address_get_port               (<a class="link" href="SoupAddress.html" title="SoupAddress">SoupAddress</a> *addr);</pre>
<p>
Returns the port associated with <em class="parameter"><code>addr</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the port
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-equal-by-name"></a><h3>soup_address_equal_by_name ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            soup_address_equal_by_name          (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr1,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr2);</pre>
<p>
Tests if <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same "name". This method can be
used with <a class="link" href="SoupAddress.html#soup-address-hash-by-name" title="soup_address_hash_by_name ()"><code class="function">soup_address_hash_by_name()</code></a> to create a <a
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
><span class="type">GHashTable</span></a> that
hashes on address "names".
</p>
<p>
Comparing by name normally means comparing the addresses by their
hostnames. But if the address was originally created using an IP
address literal, then it will be compared by that instead.
</p>
<p>
In particular, if "www.example.com" has the IP address 10.0.0.1,
and <em class="parameter"><code>addr1</code></em> was created with the name "www.example.com" and <em class="parameter"><code>addr2</code></em>
was created with the name "10.0.0.1", then they will compare as
unequal for purposes of <a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()"><code class="function">soup_address_equal_by_name()</code></a>.
</p>
<p>
This would be used to distinguish hosts in situations where
different virtual hosts on the same IP address should be considered
different. Eg, for purposes of HTTP authentication or cookies, two
hosts with the same IP address but different names are considered
to be different hosts.
</p>
<p>
See also <a class="link" href="SoupAddress.html#soup-address-equal-by-ip" title="soup_address_equal_by_ip ()"><code class="function">soup_address_equal_by_ip()</code></a>, which compares by IP address
rather than by name.</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>addr1</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>addr2</code></em> :</span></p></td>
<td> another <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved name
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> whether or not <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same name

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-hash-by-name"></a><h3>soup_address_hash_by_name ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               soup_address_hash_by_name           (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr);</pre>
<p>
A hash function (for <a
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
><span class="type">GHashTable</span></a>) that corresponds to
<a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()"><code class="function">soup_address_equal_by_name()</code></a>, qv</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the named-based hash value for <em class="parameter"><code>addr</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-equal-by-ip"></a><h3>soup_address_equal_by_ip ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"
>gboolean</a>            soup_address_equal_by_ip            (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr1,
                                                         <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr2);</pre>
<p>
Tests if <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same IP address. This method
can be used with <a class="link" href="SoupAddress.html#soup-address-hash-by-ip" title="soup_address_hash_by_ip ()"><code class="function">soup_address_hash_by_ip()</code></a> to create a
<a
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
><span class="type">GHashTable</span></a> that hashes on IP address.
</p>
<p>
This would be used to distinguish hosts in situations where
different virtual hosts on the same IP address should be considered
the same. Eg, if "www.example.com" and "www.example.net" have the
same IP address, then a single <span class="type">SoupConnection</span> can be used to talk
to either of them.
</p>
<p>
See also <a class="link" href="SoupAddress.html#soup-address-equal-by-name" title="soup_address_equal_by_name ()"><code class="function">soup_address_equal_by_name()</code></a>, which compares by name
rather than by IP address.</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>addr1</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved IP address
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>addr2</code></em> :</span></p></td>
<td> another <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a> with a resolved IP address
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> whether or not <em class="parameter"><code>addr1</code></em> and <em class="parameter"><code>addr2</code></em> have the same IP
address.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="soup-address-hash-by-ip"></a><h3>soup_address_hash_by_ip ()</h3>
<pre class="programlisting"><a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"
>guint</a>               soup_address_hash_by_ip             (<a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gconstpointer"
>gconstpointer</a> addr);</pre>
<p>
A hash function (for <a
href="/usr/share/gtk-doc/html/glib/glib-Hash-Tables.html#GHashTable"
><span class="type">GHashTable</span></a>) that corresponds to
<a class="link" href="SoupAddress.html#soup-address-equal-by-ip" title="soup_address_equal_by_ip ()"><code class="function">soup_address_equal_by_ip()</code></a>, qv</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>addr</code></em> :</span></p></td>
<td> a <a class="link" href="SoupAddress.html" title="SoupAddress"><span class="type">SoupAddress</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the IP-based hash value for <em class="parameter"><code>addr</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SOUP-ADDRESS-FAMILY--CAPS"></a><h3>SOUP_ADDRESS_FAMILY</h3>
<pre class="programlisting">#define SOUP_ADDRESS_FAMILY   "family"
</pre>
<p>
Alias for the <a class="link" href="SoupAddress.html#SoupAddress--family" title='The "family" property'><span class="type">"family"</span></a> property. (The
<a class="link" href="SoupAddress.html#SoupAddressFamily" title="enum SoupAddressFamily"><span class="type">SoupAddressFamily</span></a> for this address.)</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SOUP-ADDRESS-NAME--CAPS"></a><h3>SOUP_ADDRESS_NAME</h3>
<pre class="programlisting">#define SOUP_ADDRESS_NAME     "name"
</pre>
<p>
Alias for the <a class="link" href="SoupAddress.html#SoupAddress--name" title='The "name" property'><span class="type">"name"</span></a> property. (The hostname for
this address.)</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SOUP-ADDRESS-PHYSICAL--CAPS"></a><h3>SOUP_ADDRESS_PHYSICAL</h3>
<pre class="programlisting">#define SOUP_ADDRESS_PHYSICAL "physical"
</pre>
<p>
An alias for the <a class="link" href="SoupAddress.html#SoupAddress--physical" title='The "physical" property'><span class="type">"physical"</span></a> property. (The
stringified IP address for this address.)</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SOUP-ADDRESS-PORT--CAPS"></a><h3>SOUP_ADDRESS_PORT</h3>
<pre class="programlisting">#define SOUP_ADDRESS_PORT     "port"
</pre>
<p>
An alias for the <a class="link" href="SoupAddress.html#SoupAddress--port" title='The "port" property'><span class="type">"port"</span></a> property. (The port for
this address.)</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SOUP-ADDRESS-SOCKADDR--CAPS"></a><h3>SOUP_ADDRESS_SOCKADDR</h3>
<pre class="programlisting">#define SOUP_ADDRESS_SOCKADDR "sockaddr"
</pre>
<p>
An alias for the <a class="link" href="SoupAddress.html#SoupAddress--sockaddr" title='The "sockaddr" property'><span class="type">"sockaddr"</span></a> property. (A pointer
to the struct sockaddr for this address.)</p>
<p>
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="SoupAddress.property-details"></a><h2>Property Details</h2>
<div class="refsect2" lang="en">
<a name="SoupAddress--family"></a><h3>The <code class="literal">"family"</code> property</h3>
<pre class="programlisting">  "family"                   <a class="link" href="SoupAddress.html#SoupAddressFamily" title="enum SoupAddressFamily">SoupAddressFamily</a>     : Read / Write / Construct Only</pre>
<p>Address family for this address.</p>
<p>Default value: SOUP_ADDRESS_FAMILY_INVALID</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SoupAddress--name"></a><h3>The <code class="literal">"name"</code> property</h3>
<pre class="programlisting">  "name"                     <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*                : Read / Write / Construct Only</pre>
<p>Hostname for this address.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SoupAddress--physical"></a><h3>The <code class="literal">"physical"</code> property</h3>
<pre class="programlisting">  "physical"                 <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"
>gchar</a>*                : Read</pre>
<p>IP address for this address.</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SoupAddress--port"></a><h3>The <code class="literal">"port"</code> property</h3>
<pre class="programlisting">  "port"                     <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"
>gint</a>                  : Read / Write / Construct Only</pre>
<p>Port for this address.</p>
<p>Allowed values: [G_MAXULONG,65535]</p>
<p>Default value: -1</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="SoupAddress--sockaddr"></a><h3>The <code class="literal">"sockaddr"</code> property</h3>
<pre class="programlisting">  "sockaddr"                 <a
href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"
>gpointer</a>              : Read / Write / Construct Only</pre>
<p>struct sockaddr for this address.</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>