| 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>GSocketClient</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="highlevel-socket.html" title="Highlevel network functionallity">
<link rel="prev" href="highlevel-socket.html" title="Highlevel network functionallity">
<link rel="next" href="GSocketConnection.html" title="GSocketConnection">
<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="highlevel-socket.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="highlevel-socket.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="GSocketConnection.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GSocketClient.synopsis" class="shortcut">Top</a>
|
<a href="#GSocketClient.description" class="shortcut">Description</a>
|
<a href="#GSocketClient.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GSocketClient.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="GSocketClient">
<a name="GSocketClient"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GSocketClient.top_of_page"></a>GSocketClient</span></h2>
<p>GSocketClient — Helper for connecting to a network service</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="GSocketClient.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gio/gio.h>
<a class="link" href="GSocketClient.html#GSocketClient-struct" title="GSocketClient">GSocketClient</a>;
<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> * <a class="link" href="GSocketClient.html#g-socket-client-new" title="g_socket_client_new ()">g_socket_client_new</a> (void);
<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()">g_socket_client_connect</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a> *connectable,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
void <a class="link" href="GSocketClient.html#g-socket-client-connect-async" title="g_socket_client_connect_async ()">g_socket_client_connect_async</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a> *connectable,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * <a class="link" href="GSocketClient.html#g-socket-client-connect-finish" title="g_socket_client_connect_finish ()">g_socket_client_connect_finish</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host" title="g_socket_client_connect_to_host ()">g_socket_client_connect_to_host</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *host_and_port,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16"
>guint16</a> default_port,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
void <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-async" title="g_socket_client_connect_to_host_async ()">g_socket_client_connect_to_host_async</a>
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *host_and_port,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16"
>guint16</a> default_port,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-finish" title="g_socket_client_connect_to_host_finish ()">g_socket_client_connect_to_host_finish</a>
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service" title="g_socket_client_connect_to_service ()">g_socket_client_connect_to_service</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *domain,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *service,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
void <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service-async" title="g_socket_client_connect_to_service_async ()">g_socket_client_connect_to_service_async</a>
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *domain,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *service,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);
<a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service-finish" title="g_socket_client_connect_to_service_finish ()">g_socket_client_connect_to_service_finish</a>
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);
void <a class="link" href="GSocketClient.html#g-socket-client-set-family" title="g_socket_client_set_family ()">g_socket_client_set_family</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> family);
void <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()">g_socket_client_set_local_address</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address);
void <a class="link" href="GSocketClient.html#g-socket-client-set-protocol" title="g_socket_client_set_protocol ()">g_socket_client_set_protocol</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol">GSocketProtocol</a> protocol);
void <a class="link" href="GSocketClient.html#g-socket-client-set-socket-type" title="g_socket_client_set_socket_type ()">g_socket_client_set_socket_type</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocket.html#GSocketType" title="enum GSocketType">GSocketType</a> type);
<a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> <a class="link" href="GSocketClient.html#g-socket-client-get-family" title="g_socket_client_get_family ()">g_socket_client_get_family</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);
<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> * <a class="link" href="GSocketClient.html#g-socket-client-get-local-address" title="g_socket_client_get_local_address ()">g_socket_client_get_local_address</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);
<a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol">GSocketProtocol</a> <a class="link" href="GSocketClient.html#g-socket-client-get-protocol" title="g_socket_client_get_protocol ()">g_socket_client_get_protocol</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);
<a class="link" href="GSocket.html#GSocketType" title="enum GSocketType">GSocketType</a> <a class="link" href="GSocketClient.html#g-socket-client-get-socket-type" title="g_socket_client_get_socket_type ()">g_socket_client_get_socket_type</a> (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="GSocketClient.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>
+----GSocketClient
</pre>
</div>
<div class="refsect1" title="Properties">
<a name="GSocketClient.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GSocketClient.html#GSocketClient--family" title='The "family" property'>family</a>" <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> : Read / Write / Construct
"<a class="link" href="GSocketClient.html#GSocketClient--local-address" title='The "local-address" property'>local-address</a>" <a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a>* : Read / Write / Construct
"<a class="link" href="GSocketClient.html#GSocketClient--protocol" title='The "protocol" property'>protocol</a>" <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol">GSocketProtocol</a> : Read / Write / Construct
"<a class="link" href="GSocketClient.html#GSocketClient--type" title='The "type" property'>type</a>" <a class="link" href="GSocket.html#GSocketType" title="enum GSocketType">GSocketType</a> : Read / Write / Construct
</pre>
</div>
<div class="refsect1" title="Description">
<a name="GSocketClient.description"></a><h2>Description</h2>
<p>
<a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> is a high-level utility class for connecting to a
network host using a connection oriented socket type.
</p>
<p>
You create a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> object, set any options you want, then
call a sync or async connect operation, which returns a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>
subclass on success.
</p>
<p>
The type of the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> object returned depends on the type of
the underlying socket that is in use. For instance, for a TCP/IP connection
it will be a <a class="link" href="GSocketConnection.html#GTcpConnection"><span class="type">GTcpConnection</span></a>.</p>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="GSocketClient.details"></a><h2>Details</h2>
<div class="refsect2" title="GSocketClient">
<a name="GSocketClient-struct"></a><h3>GSocketClient</h3>
<pre class="programlisting">typedef struct _GSocketClient GSocketClient;</pre>
<p>
A helper class for network servers to listen for and accept connections.</p>
<p>
</p>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_new ()">
<a name="g-socket-client-new"></a><h3>g_socket_client_new ()</h3>
<pre class="programlisting"><a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> * g_socket_client_new (void);</pre>
<p>
Creates a new <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> with the default options.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
Free the returned object with <a
href="/usr/share/gtk-doc/html/libmissioncontrol-server/libmissioncontrol-server-mcd-debug.html#g-object-unref"
><code class="function">g_object_unref()</code></a>.
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect ()">
<a name="g-socket-client-connect"></a><h3>g_socket_client_connect ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * g_socket_client_connect (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a> *connectable,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Tries to resolve the <em class="parameter"><code>connectable</code></em> and make a network connection to it..
</p>
<p>
Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
and returned. The caller owns this new object and must drop their
reference to it when finished with it.
</p>
<p>
The type of the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> object returned depends on the type of
the underlying socket that is used. For instance, for a TCP/IP connection
it will be a <a class="link" href="GSocketConnection.html#GTcpConnection"><span class="type">GTcpConnection</span></a>.
</p>
<p>
The socket created will be the same family as the the address that the
<em class="parameter"><code>connectable</code></em> resolves to, unless family is set with <a class="link" href="GSocketClient.html#g-socket-client-set-family" title="g_socket_client_set_family ()"><code class="function">g_socket_client_set_family()</code></a>
or indirectly via <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()"><code class="function">g_socket_client_set_local_address()</code></a>. The socket type
defaults to <a class="link" href="GSocket.html#G-SOCKET-TYPE-STREAM--CAPS"><code class="literal">G_SOCKET_TYPE_STREAM</code></a> but can be set with
<a class="link" href="GSocketClient.html#g-socket-client-set-socket-type" title="g_socket_client_set_socket_type ()"><code class="function">g_socket_client_set_socket_type()</code></a>.
</p>
<p>
If a local address is specified with <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()"><code class="function">g_socket_client_set_local_address()</code></a> the
socket will be bound to this address before connecting.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>connectable</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> specifying the remote address.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <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"><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 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_async ()">
<a name="g-socket-client-connect-async"></a><h3>g_socket_client_connect_async ()</h3>
<pre class="programlisting">void g_socket_client_connect_async (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a> *connectable,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
This is the asynchronous version of <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a>.
</p>
<p>
When the operation is finished <em class="parameter"><code>callback</code></em> will be
called. You can then call <a class="link" href="GSocketClient.html#g-socket-client-connect-finish" title="g_socket_client_connect_finish ()"><code class="function">g_socket_client_connect_finish()</code></a> to get
the result of the operation.</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>client</code></em> :</span></p></td>
<td> a <span class="type">GTcpClient</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>connectable</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> specifying the remote address.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/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> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> user data for the callback
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_finish ()">
<a name="g-socket-client-connect-finish"></a><h3>g_socket_client_connect_finish ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * g_socket_client_connect_finish (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-async" title="g_socket_client_connect_async ()"><code class="function">g_socket_client_connect_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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, 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 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_to_host ()">
<a name="g-socket-client-connect-to-host"></a><h3>g_socket_client_connect_to_host ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * g_socket_client_connect_to_host (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *host_and_port,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16"
>guint16</a> default_port,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
This is a helper function for <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a>.
</p>
<p>
Attempts to create a TCP connection to the named host.
</p>
<p>
<em class="parameter"><code>host_and_port</code></em> may be in any of a number of recognised formats: an IPv6
address, an IPv4 address, or a domain name (in which case a DNS
lookup is performed). Quoting with [] is supported for all address
types. A port override may be specified in the usual way with a
colon. Ports may be given as decimal numbers or symbolic names (in
which case an /etc/services lookup is performed).
</p>
<p>
If no port override is given in <em class="parameter"><code>host_and_port</code></em> then <em class="parameter"><code>default_port</code></em> will be
used as the port number to connect to.
</p>
<p>
In general, <em class="parameter"><code>host_and_port</code></em> is expected to be provided by the user (allowing
them to give the hostname, and a port overide if necessary) and
<em class="parameter"><code>default_port</code></em> is expected to be provided by the application.
</p>
<p>
In the case that an IP address is given, a single connection
attempt is made. In the case that a name is given, multiple
connection attempts may be made, in turn and according to the
number of address records in DNS, until a connection succeeds.
</p>
<p>
Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
and returned. The caller owns this new object and must drop their
reference to it when finished with it.
</p>
<p>
In the event of any failure (DNS error, service not found, no hosts
connectable) <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> is returned and <em class="parameter"><code>error</code></em> (if non-<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>) is set
accordingly.</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>client</code></em> :</span></p></td>
<td> a <span class="type">SocketClient</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>host_and_port</code></em> :</span></p></td>
<td> the name and optionally port of the host to connect to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>default_port</code></em> :</span></p></td>
<td> the default port to connect to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a pointer to a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/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 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_to_host_async ()">
<a name="g-socket-client-connect-to-host-async"></a><h3>g_socket_client_connect_to_host_async ()</h3>
<pre class="programlisting">void g_socket_client_connect_to_host_async
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *host_and_port,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint16"
>guint16</a> default_port,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
This is the asynchronous version of <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host" title="g_socket_client_connect_to_host ()"><code class="function">g_socket_client_connect_to_host()</code></a>.
</p>
<p>
When the operation is finished <em class="parameter"><code>callback</code></em> will be
called. You can then call <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-finish" title="g_socket_client_connect_to_host_finish ()"><code class="function">g_socket_client_connect_to_host_finish()</code></a> to get
the result of the operation.</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>client</code></em> :</span></p></td>
<td> a <span class="type">GTcpClient</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>host_and_port</code></em> :</span></p></td>
<td> the name and optionally the port of the host to connect to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>default_port</code></em> :</span></p></td>
<td> the default port to connect to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/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> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> user data for the callback
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_to_host_finish ()">
<a name="g-socket-client-connect-to-host-finish"></a><h3>g_socket_client_connect_to_host_finish ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * g_socket_client_connect_to_host_finish
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-async" title="g_socket_client_connect_to_host_async ()"><code class="function">g_socket_client_connect_to_host_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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, 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 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_to_service ()">
<a name="g-socket-client-connect-to-service"></a><h3>g_socket_client_connect_to_service ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * g_socket_client_connect_to_service (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *domain,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *service,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Attempts to create a TCP connection to a service.
</p>
<p>
This call looks up the SRV record for <em class="parameter"><code>service</code></em> at <em class="parameter"><code>domain</code></em> for the
"tcp" protocol. It then attempts to connect, in turn, to each of
the hosts providing the service until either a connection succeeds
or there are no hosts remaining.
</p>
<p>
Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
and returned. The caller owns this new object and must drop their
reference to it when finished with it.
</p>
<p>
In the event of any failure (DNS error, service not found, no hosts
connectable) <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> is returned and <em class="parameter"><code>error</code></em> (if non-<a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>) is set
accordingly.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td> a domain name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td> the name of the service to connect to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a pointer to a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/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 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> if successful, or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on error
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_to_service_async ()">
<a name="g-socket-client-connect-to-service-async"></a><h3>g_socket_client_connect_to_service_async ()</h3>
<pre class="programlisting">void g_socket_client_connect_to_service_async
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *domain,
const <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"
>gchar</a> *service,
<a class="link" href="GCancellable.html" title="GCancellable">GCancellable</a> *cancellable,
<a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()">GAsyncReadyCallback</a> callback,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
>gpointer</a> user_data);</pre>
<p>
This is the asynchronous version of
<a class="link" href="GSocketClient.html#g-socket-client-connect-to-service" title="g_socket_client_connect_to_service ()"><code class="function">g_socket_client_connect_to_service()</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td> a domain name
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>service</code></em> :</span></p></td>
<td> the name of the service to connect to
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a
href="http://library.gnome.org/devel/glib/unstable/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> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td> user data for the callback
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_connect_to_service_finish ()">
<a name="g-socket-client-connect-to-service-finish"></a><h3>g_socket_client_connect_to_service_finish ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection">GSocketConnection</a> * g_socket_client_connect_to_service_finish
(<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GAsyncResult.html" title="GAsyncResult">GAsyncResult</a> *result,
<a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
>GError</a> **error);</pre>
<p>
Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service-async" title="g_socket_client_connect_to_service_async ()"><code class="function">g_socket_client_connect_to_service_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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
<td> a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td> a <a
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
><span class="type">GError</span></a> location to store the error occuring, 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 <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a> on error.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_set_family ()">
<a name="g-socket-client-set-family"></a><h3>g_socket_client_set_family ()</h3>
<pre class="programlisting">void g_socket_client_set_family (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> family);</pre>
<p>
Sets the socket family of the socket client.
If this is set to something other than <a class="link" href="GSocketAddress.html#G-SOCKET-FAMILY-INVALID--CAPS"><code class="literal">G_SOCKET_FAMILY_INVALID</code></a>
then the sockets created by this object will be of the specified
family.
</p>
<p>
This might be useful for instance if you want to force the local
connection to be an ipv4 socket, even though the address might
be an ipv6 mapped to ipv4 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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>family</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_set_local_address ()">
<a name="g-socket-client-set-local-address"></a><h3>g_socket_client_set_local_address ()</h3>
<pre class="programlisting">void g_socket_client_set_local_address (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> *address);</pre>
<p>
Sets the local address of the socket client.
The sockets created by this object will bound to the
specified address (if not <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>) before connecting.
</p>
<p>
This is useful if you want to ensure the the local
side of the connection is on a specific port, or on
a specific interface.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<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>, or <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_client_set_protocol ()">
<a name="g-socket-client-set-protocol"></a><h3>g_socket_client_set_protocol ()</h3>
<pre class="programlisting">void g_socket_client_set_protocol (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol">GSocketProtocol</a> protocol);</pre>
<p>
Sets the protocol of the socket client.
The sockets created by this object will use of the specified
protocol.
</p>
<p>
If <em class="parameter"><code>protocol</code></em> is <code class="literal">0</code> that means to use the default
protocol for the socket family and type.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>protocol</code></em> :</span></p></td>
<td> a <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_set_socket_type ()">
<a name="g-socket-client-set-socket-type"></a><h3>g_socket_client_set_socket_type ()</h3>
<pre class="programlisting">void g_socket_client_set_socket_type (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client,
<a class="link" href="GSocket.html#GSocketType" title="enum GSocketType">GSocketType</a> type);</pre>
<p>
Sets the socket type of the socket client.
The sockets created by this object will be of the specified
type.
</p>
<p>
It doesn't make sense to specify a type of <a class="link" href="GSocket.html#G-SOCKET-TYPE-DATAGRAM--CAPS"><code class="literal">G_SOCKET_TYPE_DATAGRAM</code></a>,
as GSocketClient is used for connection oriented services.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td> a <a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_get_family ()">
<a name="g-socket-client-get-family"></a><h3>g_socket_client_get_family ()</h3>
<pre class="programlisting"><a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily">GSocketFamily</a> g_socket_client_get_family (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);</pre>
<p>
Gets the socket family of the socket client.
</p>
<p>
See <a class="link" href="GSocketClient.html#g-socket-client-set-family" title="g_socket_client_set_family ()"><code class="function">g_socket_client_set_family()</code></a> for details.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_get_local_address ()">
<a name="g-socket-client-get-local-address"></a><h3>g_socket_client_get_local_address ()</h3>
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a> * g_socket_client_get_local_address (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);</pre>
<p>
Gets the local address of the socket client.
</p>
<p>
See <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()"><code class="function">g_socket_client_set_local_address()</code></a> for details.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <span class="type">GSocketAddres</span> or <a
href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL--CAPS"
><code class="literal">NULL</code></a>. don't free
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_get_protocol ()">
<a name="g-socket-client-get-protocol"></a><h3>g_socket_client_get_protocol ()</h3>
<pre class="programlisting"><a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol">GSocketProtocol</a> g_socket_client_get_protocol (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);</pre>
<p>
Gets the protocol name type of the socket client.
</p>
<p>
See <a class="link" href="GSocketClient.html#g-socket-client-set-protocol" title="g_socket_client_set_protocol ()"><code class="function">g_socket_client_set_protocol()</code></a> for details.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
<hr>
<div class="refsect2" title="g_socket_client_get_socket_type ()">
<a name="g-socket-client-get-socket-type"></a><h3>g_socket_client_get_socket_type ()</h3>
<pre class="programlisting"><a class="link" href="GSocket.html#GSocketType" title="enum GSocketType">GSocketType</a> g_socket_client_get_socket_type (<a class="link" href="GSocketClient.html" title="GSocketClient">GSocketClient</a> *client);</pre>
<p>
Gets the socket type of the socket client.
</p>
<p>
See <a class="link" href="GSocketClient.html#g-socket-client-set-socket-type" title="g_socket_client_set_socket_type ()"><code class="function">g_socket_client_set_socket_type()</code></a> for details.</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>client</code></em> :</span></p></td>
<td> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.22</p>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="GSocketClient.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "family" property'>
<a name="GSocketClient--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 / Write / Construct</pre>
<p>The sockets address family to use for socket construction.</p>
<p>Default value: G_SOCKET_FAMILY_INVALID</p>
</div>
<hr>
<div class="refsect2" title='The "local-address" property'>
<a name="GSocketClient--local-address"></a><h3>The <code class="literal">"local-address"</code> property</h3>
<pre class="programlisting"> "local-address" <a class="link" href="GSocketAddress.html" title="GSocketAddress">GSocketAddress</a>* : Read / Write / Construct</pre>
<p>The local address constructed sockets will be bound to.</p>
</div>
<hr>
<div class="refsect2" title='The "protocol" property'>
<a name="GSocketClient--protocol"></a><h3>The <code class="literal">"protocol"</code> property</h3>
<pre class="programlisting"> "protocol" <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol">GSocketProtocol</a> : Read / Write / Construct</pre>
<p>The protocol to use for socket construction, or 0 for default.</p>
<p>Default value: G_SOCKET_PROTOCOL_DEFAULT</p>
</div>
<hr>
<div class="refsect2" title='The "type" property'>
<a name="GSocketClient--type"></a><h3>The <code class="literal">"type"</code> property</h3>
<pre class="programlisting"> "type" <a class="link" href="GSocket.html#GSocketType" title="enum GSocketType">GSocketType</a> : Read / Write / Construct</pre>
<p>The sockets type to use for socket construction.</p>
<p>Default value: G_SOCKET_TYPE_STREAM</p>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="GSocketClient.see-also"></a><h2>See Also</h2>
#GSocketConnection, <a class="link" href="GSocketListener.html" title="GSocketListener"><span class="type">GSocketListener</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.11</div>
</body>
</html>