482
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
482
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
483
483
<td class="property_name"><a class="link" href="GSocket.html#GSocket--blocking" title="The “blocking” property">blocking</a></td>
484
484
<td class="property_flags">Read / Write</td>
487
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
487
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
488
488
<td class="property_name"><a class="link" href="GSocket.html#GSocket--broadcast" title="The “broadcast” property">broadcast</a></td>
489
489
<td class="property_flags">Read / Write</td>
494
494
<td class="property_flags">Read / Write / Construct Only</td>
497
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
497
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
498
498
<td class="property_name"><a class="link" href="GSocket.html#GSocket--fd" title="The “fd” property">fd</a></td>
499
499
<td class="property_flags">Read / Write / Construct Only</td>
502
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
502
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
503
503
<td class="property_name"><a class="link" href="GSocket.html#GSocket--keepalive" title="The “keepalive” property">keepalive</a></td>
504
504
<td class="property_flags">Read / Write</td>
507
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
507
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
508
508
<td class="property_name"><a class="link" href="GSocket.html#GSocket--listen-backlog" title="The “listen-backlog” property">listen-backlog</a></td>
509
509
<td class="property_flags">Read / Write</td>
515
515
<td class="property_flags">Read</td>
518
<td class="property_type"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
518
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
519
519
<td class="property_name"><a class="link" href="GSocket.html#GSocket--multicast-loopback" title="The “multicast-loopback” property">multicast-loopback</a></td>
520
520
<td class="property_flags">Read / Write</td>
523
<td class="property_type"><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
523
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
524
524
<td class="property_name"><a class="link" href="GSocket.html#GSocket--multicast-ttl" title="The “multicast-ttl” property">multicast-ttl</a></td>
525
525
<td class="property_flags">Read / Write</td>
536
536
<td class="property_flags">Read</td>
539
<td class="property_type"><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
539
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
540
540
<td class="property_name"><a class="link" href="GSocket.html#GSocket--timeout" title="The “timeout” property">timeout</a></td>
541
541
<td class="property_flags">Read / Write</td>
544
<td class="property_type"><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
544
<td class="property_type"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
545
545
<td class="property_name"><a class="link" href="GSocket.html#GSocket--ttl" title="The “ttl” property">ttl</a></td>
546
546
<td class="property_flags">Read / Write</td>
616
616
<a class="link" href="GSocketService.html" title="GSocketService"><span class="type">GSocketService</span></a> and <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>. However there may be cases where
617
617
direct use of <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> is useful.</p>
618
618
<p><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> implements the <a class="link" href="GInitable.html" title="GInitable"><span class="type">GInitable</span></a> interface, so if it is manually constructed
619
by e.g. <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-new"><code class="function">g_object_new()</code></a> you must call <a class="link" href="GInitable.html#g-initable-init" title="g_initable_init ()"><code class="function">g_initable_init()</code></a> and check the
619
by e.g. <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-new"><code class="function">g_object_new()</code></a> you must call <a class="link" href="GInitable.html#g-initable-init" title="g_initable_init ()"><code class="function">g_initable_init()</code></a> and check the
620
620
results before using the object. This is done automatically in
621
621
<a class="link" href="GSocket.html#g-socket-new" title="g_socket_new ()"><code class="function">g_socket_new()</code></a> and <a class="link" href="GSocket.html#g-socket-new-from-fd" title="g_socket_new_from_fd ()"><code class="function">g_socket_new_from_fd()</code></a>, so these functions can return
622
<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
622
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
623
623
<p>Sockets operate in two general modes, blocking or non-blocking. When
624
624
in blocking mode all operations block until the requested operation
625
625
is finished or there is an error. In non-blocking mode all calls that
626
626
would block return immediately with a <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> error.
627
627
To know when a call would successfully run you can call <a class="link" href="GSocket.html#g-socket-condition-check" title="g_socket_condition_check ()"><code class="function">g_socket_condition_check()</code></a>,
628
628
or <a class="link" href="GSocket.html#g-socket-condition-wait" title="g_socket_condition_wait ()"><code class="function">g_socket_condition_wait()</code></a>. You can also use <a class="link" href="GSocket.html#g-socket-create-source" title="g_socket_create_source ()"><code class="function">g_socket_create_source()</code></a> and
629
attach it to a <a href="../glib/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> to get callbacks when I/O is possible.
629
attach it to a <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> to get callbacks when I/O is possible.
630
630
Note that all sockets are always set to non blocking mode in the system, and
631
631
blocking mode is emulated in GSocket.</p>
632
632
<p>When working in non-blocking mode applications should always be able to
651
651
<a name="GSocket.functions_details"></a><h2>Functions</h2>
652
652
<div class="refsect2">
653
653
<a name="GSocketSourceFunc"></a><h3>GSocketSourceFunc ()</h3>
654
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
654
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
655
655
<span class="c_punctuation">(</span>*GSocketSourceFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
656
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
657
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
658
<p>This is the function type of the callback used for the <a href="../glib/glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a>
656
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
657
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
658
<p>This is the function type of the callback used for the <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a>
659
659
returned by <a class="link" href="GSocket.html#g-socket-create-source" title="g_socket_create_source ()"><code class="function">g_socket_create_source()</code></a>.</p>
660
660
<div class="refsect3">
661
661
<a name="id-1.4.13.2.10.2.5"></a><h4>Parameters</h4>
698
698
g_socket_new (<em class="parameter"><code><a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a> family</code></em>,
699
699
<em class="parameter"><code><a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a> type</code></em>,
700
700
<em class="parameter"><code><a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a> protocol</code></em>,
701
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
701
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
702
702
<p>Creates a new <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> with the defined family, type and protocol.
703
703
If <em class="parameter"><code>protocol</code></em>
704
704
is 0 (<a class="link" href="GSocket.html#G-SOCKET-PROTOCOL-DEFAULT:CAPS"><code class="literal">G_SOCKET_PROTOCOL_DEFAULT</code></a>) the default protocol type
756
756
<div class="refsect2">
757
757
<a name="g-socket-new-from-fd"></a><h3>g_socket_new_from_fd ()</h3>
758
758
<pre class="programlisting"><a class="link" href="GSocket.html" title="GSocket"><span class="returnvalue">GSocket</span></a> *
759
g_socket_new_from_fd (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>,
760
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
759
g_socket_new_from_fd (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> fd</code></em>,
760
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
761
761
<p>Creates a new <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> from a native file descriptor
762
762
or winsock SOCKET handle.</p>
763
763
<p>This reads all the settings from the file descriptor so that
798
798
<div class="refsect2">
799
799
<a name="g-socket-bind"></a><h3>g_socket_bind ()</h3>
800
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
800
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
801
801
g_socket_bind (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
802
802
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
803
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allow_reuse</code></em>,
804
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
803
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allow_reuse</code></em>,
804
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
805
805
<p>When a socket is created it is attached to an address family, but it
806
806
doesn't have an address in this family. <a class="link" href="GSocket.html#g-socket-bind" title="g_socket_bind ()"><code class="function">g_socket_bind()</code></a> assigns the
807
807
address (sometimes called name) of the socket.</p>
812
812
<p>If <em class="parameter"><code>socket</code></em>
813
813
is a TCP socket, then <em class="parameter"><code>allow_reuse</code></em>
814
814
controls the setting
815
of the <code class="literal">SO_REUSEADDR</code> socket option; normally it should be <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for
815
of the <code class="literal">SO_REUSEADDR</code> socket option; normally it should be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> for
816
816
server sockets (sockets that you will eventually call
817
<a class="link" href="GSocket.html#g-socket-accept" title="g_socket_accept ()"><code class="function">g_socket_accept()</code></a> on), and <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> for client sockets. (Failing to
817
<a class="link" href="GSocket.html#g-socket-accept" title="g_socket_accept ()"><code class="function">g_socket_accept()</code></a> on), and <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> for client sockets. (Failing to
818
818
set this flag on a server socket may cause <a class="link" href="GSocket.html#g-socket-bind" title="g_socket_bind ()"><code class="function">g_socket_bind()</code></a> to return
819
819
<a class="link" href="gio-GIOError.html#G-IO-ERROR-ADDRESS-IN-USE:CAPS"><code class="literal">G_IO_ERROR_ADDRESS_IN_USE</code></a> if the server program is stopped and then
820
820
immediately restarted.)</p>
869
869
<div class="refsect2">
870
870
<a name="g-socket-listen"></a><h3>g_socket_listen ()</h3>
871
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
871
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
872
872
g_socket_listen (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
873
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
873
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
874
874
<p>Marks the socket as a server socket, i.e. a socket that is used
875
875
to accept incoming requests using <a class="link" href="GSocket.html#g-socket-accept" title="g_socket_accept ()"><code class="function">g_socket_accept()</code></a>.</p>
876
876
<p>Before calling this the socket must be bound to a local address using
912
912
<pre class="programlisting"><a class="link" href="GSocket.html" title="GSocket"><span class="returnvalue">GSocket</span></a> *
913
913
g_socket_accept (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
914
914
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
915
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
915
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
916
916
<p>Accept incoming connections on a connection-based socket. This removes
917
917
the first outstanding connection request from the listening socket and
918
918
creates a <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> object for it.</p>
921
921
must be listening for incoming connections (<a class="link" href="GSocket.html#g-socket-listen" title="g_socket_listen ()"><code class="function">g_socket_listen()</code></a>).</p>
922
922
<p>If there are no outstanding connections then the operation will block
923
923
or return <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> if non-blocking I/O is enabled.
924
To be notified of an incoming connection, wait for the <code class="literal">G_IO_IN</code> condition.</p>
924
To be notified of an incoming connection, wait for the <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-IN:CAPS"><code class="literal">G_IO_IN</code></a> condition.</p>
925
925
<div class="refsect3">
926
926
<a name="id-1.4.13.2.10.7.7"></a><h4>Parameters</h4>
927
927
<div class="informaltable"><table width="100%" border="0">
940
940
<td class="parameter_name"><p>cancellable</p></td>
941
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
941
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
942
942
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
945
945
<td class="parameter_name"><p>error</p></td>
946
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
946
<td class="parameter_description"><p><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.</p></td>
947
947
<td class="parameter_annotations"> </td>
952
952
<div class="refsect3">
953
953
<a name="id-1.4.13.2.10.7.8"></a><h4>Returns</h4>
954
<p> a new <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
955
Free the returned object with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
954
<p> a new <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
955
Free the returned object with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
956
956
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
958
958
<p class="since">Since 2.22</p>
961
961
<div class="refsect2">
962
962
<a name="g-socket-connect"></a><h3>g_socket_connect ()</h3>
963
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
963
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
964
964
g_socket_connect (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
965
965
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
966
966
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
967
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
967
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
968
968
<p>Connect the socket to the specified remote address.</p>
969
969
<p>For connection oriented socket this generally means we attempt to make
970
970
a connection to the <em class="parameter"><code>address</code></em>
1002
1002
<td class="parameter_name"><p>cancellable</p></td>
1003
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1003
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1004
1004
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1007
1007
<td class="parameter_name"><p>error</p></td>
1008
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1008
<td class="parameter_description"><p><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.</p></td>
1009
1009
<td class="parameter_annotations"> </td>
1022
1022
<div class="refsect2">
1023
1023
<a name="g-socket-check-connect-result"></a><h3>g_socket_check_connect_result ()</h3>
1024
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1024
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1025
1025
g_socket_check_connect_result (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1026
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1026
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1027
1027
<p>Checks and resets the pending connect error for the socket.
1028
1028
This is used to check for errors when <a class="link" href="GSocket.html#g-socket-connect" title="g_socket_connect ()"><code class="function">g_socket_connect()</code></a> is
1029
1029
used in non-blocking mode.</p>
1061
1061
<div class="refsect2">
1062
1062
<a name="g-socket-receive"></a><h3>g_socket_receive ()</h3>
1063
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1063
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1064
1064
g_socket_receive (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1065
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1066
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1065
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1066
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1067
1067
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1068
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1068
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1069
1069
<p>Receive data (up to <em class="parameter"><code>size</code></em>
1070
1070
bytes) from a socket. This is mainly used by
1071
1071
connection-oriented sockets; it is identical to <a class="link" href="GSocket.html#g-socket-receive-from" title="g_socket_receive_from ()"><code class="function">g_socket_receive_from()</code></a>
1072
1072
with <em class="parameter"><code>address</code></em>
1073
set to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1073
set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1074
1074
<p>For <a class="link" href="GSocket.html#G-SOCKET-TYPE-DATAGRAM:CAPS"><code class="literal">G_SOCKET_TYPE_DATAGRAM</code></a> and <a class="link" href="GSocket.html#G-SOCKET-TYPE-SEQPACKET:CAPS"><code class="literal">G_SOCKET_TYPE_SEQPACKET</code></a> sockets,
1075
1075
<a class="link" href="GSocket.html#g-socket-receive" title="g_socket_receive ()"><code class="function">g_socket_receive()</code></a> will always read either 0 or 1 complete messages from
1076
1076
the socket. If the received message is too large to fit in <em class="parameter"><code>buffer</code></em>
1122
1122
<td class="parameter_name"><p>cancellable</p></td>
1123
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1123
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1124
1124
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1127
1127
<td class="parameter_name"><p>error</p></td>
1128
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1128
<td class="parameter_description"><p><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.</p></td>
1129
1129
<td class="parameter_annotations"> </td>
1143
1143
<div class="refsect2">
1144
1144
<a name="g-socket-receive-from"></a><h3>g_socket_receive_from ()</h3>
1145
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1145
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1146
1146
g_socket_receive_from (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1147
1147
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> **address</code></em>,
1148
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1149
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1148
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1149
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1150
1150
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1151
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1151
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1152
1152
<p>Receive data (up to <em class="parameter"><code>size</code></em>
1153
1153
bytes) from a socket.</p>
1154
1154
<p>If <em class="parameter"><code>address</code></em>
1155
is non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then <em class="parameter"><code>address</code></em>
1155
is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then <em class="parameter"><code>address</code></em>
1156
1156
will be set equal to the
1157
1157
source address of the received packet.
1158
1158
<em class="parameter"><code>address</code></em>
1194
1194
<td class="parameter_name"><p>cancellable</p></td>
1195
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1195
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1196
1196
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1199
1199
<td class="parameter_name"><p>error</p></td>
1200
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1200
<td class="parameter_description"><p><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.</p></td>
1201
1201
<td class="parameter_annotations"> </td>
1215
1215
<div class="refsect2">
1216
1216
<a name="g-socket-receive-message"></a><h3>g_socket_receive_message ()</h3>
1217
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1217
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1218
1218
g_socket_receive_message (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1219
1219
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> **address</code></em>,
1220
1220
<em class="parameter"><code><a class="link" href="GSocket.html#GInputVector" title="struct GInputVector"><span class="type">GInputVector</span></a> *vectors</code></em>,
1221
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_vectors</code></em>,
1221
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_vectors</code></em>,
1222
1222
<em class="parameter"><code><a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> ***messages</code></em>,
1223
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *num_messages</code></em>,
1224
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *flags</code></em>,
1223
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *num_messages</code></em>,
1224
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *flags</code></em>,
1225
1225
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1226
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1226
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1227
1227
<p>Receive data from a socket. This is the most complicated and
1228
1228
fully-featured version of this call. For easier use, see
1229
1229
<a class="link" href="GSocket.html#g-socket-receive" title="g_socket_receive ()"><code class="function">g_socket_receive()</code></a> and <a class="link" href="GSocket.html#g-socket-receive-from" title="g_socket_receive_from ()"><code class="function">g_socket_receive_from()</code></a>.</p>
1230
1230
<p>If <em class="parameter"><code>address</code></em>
1231
is non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then <em class="parameter"><code>address</code></em>
1231
is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then <em class="parameter"><code>address</code></em>
1232
1232
will be set equal to the
1233
1233
source address of the received packet.
1234
1234
<em class="parameter"><code>address</code></em>
1241
1241
If <em class="parameter"><code>num_vectors</code></em>
1242
1242
is -1, then <em class="parameter"><code>vectors</code></em>
1243
1243
is assumed to be terminated
1244
by a <a class="link" href="GSocket.html#GInputVector" title="struct GInputVector"><span class="type">GInputVector</span></a> with a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> buffer pointer.</p>
1244
by a <a class="link" href="GSocket.html#GInputVector" title="struct GInputVector"><span class="type">GInputVector</span></a> with a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> buffer pointer.</p>
1245
1245
<p>As a special case, if <em class="parameter"><code>num_vectors</code></em>
1246
1246
is 0 (in which case, <em class="parameter"><code>vectors</code></em>
1248
may of course be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>), then a single byte is received and
1248
may of course be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>), then a single byte is received and
1249
1249
discarded. This is to facilitate the common practice of sending a
1250
1250
single '\0' byte for the purposes of transferring ancillary data.</p>
1251
1251
<p><em class="parameter"><code>messages</code></em>
1252
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, will be set to point to a newly-allocated
1253
array of <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> instances or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no such
1252
, if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, will be set to point to a newly-allocated
1253
array of <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> instances or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no such
1254
1254
messages was received. These correspond to the control messages
1255
1255
received from the kernel, one <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> per message
1256
from the kernel. This array is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated and must be freed
1257
by the caller using <a href="../glib/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> after calling <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> on each
1256
from the kernel. This array is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated and must be freed
1257
by the caller using <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> after calling <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a> on each
1258
1258
element. If <em class="parameter"><code>messages</code></em>
1259
is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, any control messages received will
1259
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, any control messages received will
1260
1260
be discarded.</p>
1261
1261
<p><em class="parameter"><code>num_messages</code></em>
1262
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, will be set to the number of control
1262
, if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, will be set to the number of control
1263
1263
messages received.</p>
1264
1264
<p>If both <em class="parameter"><code>messages</code></em>
1265
1265
and <em class="parameter"><code>num_messages</code></em>
1266
are non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then
1266
are non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then
1267
1267
<em class="parameter"><code>num_messages</code></em>
1268
1268
gives the number of <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> instances
1269
1269
in <em class="parameter"><code>messages</code></em>
1270
(ie: not including the <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminator).</p>
1270
(ie: not including the <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminator).</p>
1271
1271
<p><em class="parameter"><code>flags</code></em>
1272
1272
is an in/out parameter. The commonly available arguments
1273
1273
for this are available in the <a class="link" href="GSocket.html#GSocketMsgFlags" title="enum GSocketMsgFlags"><span class="type">GSocketMsgFlags</span></a> enum, but the
1326
1326
<td class="parameter_name"><p>messages</p></td>
1327
1327
<td class="parameter_description"><p> a pointer which
1328
may be filled with an array of <a href="GSocketControlMessage.html"><span class="type">GSocketControlMessages</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1328
may be filled with an array of <a href="GSocketControlMessage.html"><span class="type">GSocketControlMessages</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1329
1329
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=num_messages][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1332
1332
<td class="parameter_name"><p>num_messages</p></td>
1333
1333
<td class="parameter_description"><p>a pointer which will be filled with the number of
1334
1334
elements in <em class="parameter"><code>messages</code></em>
1335
, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1335
, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1336
1336
<td class="parameter_annotations"> </td>
1344
1344
<td class="parameter_name"><p>cancellable</p></td>
1345
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1345
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1346
1346
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1349
1349
<td class="parameter_name"><p>error</p></td>
1350
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1350
<td class="parameter_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1351
1351
<td class="parameter_annotations"> </td>
1365
1365
<div class="refsect2">
1366
1366
<a name="g-socket-receive-with-blocking"></a><h3>g_socket_receive_with_blocking ()</h3>
1367
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1367
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1368
1368
g_socket_receive_with_blocking (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1369
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1370
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1371
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>,
1369
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1370
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1371
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>,
1372
1372
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1373
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1373
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1374
1374
<p>This behaves exactly the same as <a class="link" href="GSocket.html#g-socket-receive" title="g_socket_receive ()"><code class="function">g_socket_receive()</code></a>, except that
1375
1375
the choice of blocking or non-blocking behavior is determined by
1376
1376
the <em class="parameter"><code>blocking</code></em>
1411
1411
<td class="parameter_name"><p>cancellable</p></td>
1412
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1412
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1413
1413
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1416
1416
<td class="parameter_name"><p>error</p></td>
1417
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1417
<td class="parameter_description"><p><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.</p></td>
1418
1418
<td class="parameter_annotations"> </td>
1432
1432
<div class="refsect2">
1433
1433
<a name="g-socket-send"></a><h3>g_socket_send ()</h3>
1434
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1434
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1435
1435
g_socket_send (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1436
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1437
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1436
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1437
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1438
1438
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1439
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1439
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1440
1440
<p>Tries to send <em class="parameter"><code>size</code></em>
1441
1441
bytes from <em class="parameter"><code>buffer</code></em>
1442
1442
on the socket. This is
1443
1443
mainly used by connection-oriented sockets; it is identical to
1444
1444
<a class="link" href="GSocket.html#g-socket-send-to" title="g_socket_send_to ()"><code class="function">g_socket_send_to()</code></a> with <em class="parameter"><code>address</code></em>
1445
set to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1445
set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1446
1446
<p>If the socket is in blocking mode the call will block until there is
1447
1447
space for the data in the socket queue. If there is no space available
1448
1448
and the socket is in non-blocking mode a <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> error
1449
1449
will be returned. To be notified when space is available, wait for the
1450
<code class="literal">G_IO_OUT</code> condition. Note though that you may still receive
1450
<a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-OUT:CAPS"><code class="literal">G_IO_OUT</code></a> condition. Note though that you may still receive
1451
1451
<a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> from <a class="link" href="GSocket.html#g-socket-send" title="g_socket_send ()"><code class="function">g_socket_send()</code></a> even if you were previously
1452
notified of a <code class="literal">G_IO_OUT</code> condition. (On Windows in particular, this is
1452
notified of a <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-OUT:CAPS"><code class="literal">G_IO_OUT</code></a> condition. (On Windows in particular, this is
1453
1453
very common due to the way the underlying APIs work.)</p>
1454
1454
<p>On error -1 is returned and <em class="parameter"><code>error</code></em>
1455
1455
is set accordingly.</p>
1482
1482
<td class="parameter_name"><p>cancellable</p></td>
1483
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1483
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1484
1484
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1487
1487
<td class="parameter_name"><p>error</p></td>
1488
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1488
<td class="parameter_description"><p><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.</p></td>
1489
1489
<td class="parameter_annotations"> </td>
1504
1504
<div class="refsect2">
1505
1505
<a name="g-socket-send-to"></a><h3>g_socket_send_to ()</h3>
1506
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1506
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1507
1507
g_socket_send_to (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1508
1508
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
1509
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1510
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1509
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1510
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1511
1511
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1512
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1512
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1513
1513
<p>Tries to send <em class="parameter"><code>size</code></em>
1514
1514
bytes from <em class="parameter"><code>buffer</code></em>
1515
1515
to <em class="parameter"><code>address</code></em>
1516
1516
. If <em class="parameter"><code>address</code></em>
1518
<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then the message is sent to the default receiver (set by
1518
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then the message is sent to the default receiver (set by
1519
1519
<a class="link" href="GSocket.html#g-socket-connect" title="g_socket_connect ()"><code class="function">g_socket_connect()</code></a>).</p>
1520
1520
<p>See <a class="link" href="GSocket.html#g-socket-send" title="g_socket_send ()"><code class="function">g_socket_send()</code></a> for additional information.</p>
1521
1521
<div class="refsect3">
1552
1552
<td class="parameter_name"><p>cancellable</p></td>
1553
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1553
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1554
1554
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1557
1557
<td class="parameter_name"><p>error</p></td>
1558
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1558
<td class="parameter_description"><p><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.</p></td>
1559
1559
<td class="parameter_annotations"> </td>
1574
1574
<div class="refsect2">
1575
1575
<a name="g-socket-send-message"></a><h3>g_socket_send_message ()</h3>
1576
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1576
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1577
1577
g_socket_send_message (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1578
1578
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
1579
1579
<em class="parameter"><code><a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> *vectors</code></em>,
1580
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_vectors</code></em>,
1580
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_vectors</code></em>,
1581
1581
<em class="parameter"><code><a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> **messages</code></em>,
1582
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_messages</code></em>,
1583
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> flags</code></em>,
1582
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_messages</code></em>,
1583
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> flags</code></em>,
1584
1584
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1585
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1585
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1586
1586
<p>Send data to <em class="parameter"><code>address</code></em>
1587
1587
on <em class="parameter"><code>socket</code></em>
1588
1588
. This is the most complicated and
1589
1589
fully-featured version of this call. For easier use, see
1590
1590
<a class="link" href="GSocket.html#g-socket-send" title="g_socket_send ()"><code class="function">g_socket_send()</code></a> and <a class="link" href="GSocket.html#g-socket-send-to" title="g_socket_send_to ()"><code class="function">g_socket_send_to()</code></a>.</p>
1591
1591
<p>If <em class="parameter"><code>address</code></em>
1592
is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then the message is sent to the default receiver
1592
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then the message is sent to the default receiver
1593
1593
(set by <a class="link" href="GSocket.html#g-socket-connect" title="g_socket_connect ()"><code class="function">g_socket_connect()</code></a>).</p>
1594
1594
<p><em class="parameter"><code>vectors</code></em>
1595
1595
must point to an array of <a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> structs and
1599
1599
then <em class="parameter"><code>vectors</code></em>
1600
1600
is assumed to be terminated by a <a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> with a
1601
<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> buffer pointer.) The <a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> structs describe the buffers
1601
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> buffer pointer.) The <a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> structs describe the buffers
1602
1602
that the sent data will be gathered from. Using multiple
1603
1603
<a href="GSocket.html#GOutputVector"><span class="type">GOutputVectors</span></a> is more memory-efficient than manually copying
1604
1604
data from multiple sources into a single buffer, and more
1605
1605
network-efficient than making multiple calls to <a class="link" href="GSocket.html#g-socket-send" title="g_socket_send ()"><code class="function">g_socket_send()</code></a>.</p>
1606
1606
<p><em class="parameter"><code>messages</code></em>
1607
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, is taken to point to an array of <em class="parameter"><code>num_messages</code></em>
1607
, if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, is taken to point to an array of <em class="parameter"><code>num_messages</code></em>
1609
1609
<a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> instances. These correspond to the control
1610
1610
messages to be sent on the socket.
1611
1611
If <em class="parameter"><code>num_messages</code></em>
1612
1612
is -1 then <em class="parameter"><code>messages</code></em>
1613
is treated as a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated
1613
is treated as a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated
1615
1615
<p><em class="parameter"><code>flags</code></em>
1616
1616
modify how the message is sent. The commonly available arguments
1621
1621
space for the data in the socket queue. If there is no space available
1622
1622
and the socket is in non-blocking mode a <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> error
1623
1623
will be returned. To be notified when space is available, wait for the
1624
<code class="literal">G_IO_OUT</code> condition. Note though that you may still receive
1624
<a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-OUT:CAPS"><code class="literal">G_IO_OUT</code></a> condition. Note though that you may still receive
1625
1625
<a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a> from <a class="link" href="GSocket.html#g-socket-send" title="g_socket_send ()"><code class="function">g_socket_send()</code></a> even if you were previously
1626
notified of a <code class="literal">G_IO_OUT</code> condition. (On Windows in particular, this is
1626
notified of a <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-OUT:CAPS"><code class="literal">G_IO_OUT</code></a> condition. (On Windows in particular, this is
1627
1627
very common due to the way the underlying APIs work.)</p>
1628
1628
<p>On error -1 is returned and <em class="parameter"><code>error</code></em>
1629
1629
is set accordingly.</p>
1678
1678
<td class="parameter_name"><p>cancellable</p></td>
1679
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1679
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1680
1680
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1683
1683
<td class="parameter_name"><p>error</p></td>
1684
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1684
<td class="parameter_description"><p><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.</p></td>
1685
1685
<td class="parameter_annotations"> </td>
1700
1700
<div class="refsect2">
1701
1701
<a name="g-socket-send-with-blocking"></a><h3>g_socket_send_with_blocking ()</h3>
1702
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1702
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1703
1703
g_socket_send_with_blocking (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1704
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1705
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1706
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>,
1704
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1705
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1706
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>,
1707
1707
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1708
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1708
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1709
1709
<p>This behaves exactly the same as <a class="link" href="GSocket.html#g-socket-send" title="g_socket_send ()"><code class="function">g_socket_send()</code></a>, except that
1710
1710
the choice of blocking or non-blocking behavior is determined by
1711
1711
the <em class="parameter"><code>blocking</code></em>
1745
1745
<td class="parameter_name"><p>cancellable</p></td>
1746
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1746
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1747
1747
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
1750
1750
<td class="parameter_name"><p>error</p></td>
1751
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
1751
<td class="parameter_description"><p><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.</p></td>
1752
1752
<td class="parameter_annotations"> </td>
1767
1767
<div class="refsect2">
1768
1768
<a name="g-socket-close"></a><h3>g_socket_close ()</h3>
1769
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1769
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1770
1770
g_socket_close (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1771
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1771
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1772
1772
<p>Closes the socket, shutting down any active connection.</p>
1773
1773
<p>Closing a socket does not wait for all outstanding I/O operations
1774
1774
to finish, so the caller should not rely on them to be guaranteed
1781
1781
resources are released as early as possible.</p>
1782
1782
<p>Beware that due to the way that TCP works, it is possible for
1783
1783
recently-sent data to be lost if either you close a socket while the
1784
<code class="literal">G_IO_IN</code> condition is set, or else if the remote connection tries to
1784
<a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-IN:CAPS"><code class="literal">G_IO_IN</code></a> condition is set, or else if the remote connection tries to
1785
1785
send something to you after you close the socket but before it has
1786
1786
finished reading all of the data you sent. There is no easy generic
1787
1787
way to avoid this problem; the easiest fix is to design the network
1856
1856
<div class="refsect2">
1857
1857
<a name="g-socket-shutdown"></a><h3>g_socket_shutdown ()</h3>
1858
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1858
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1859
1859
g_socket_shutdown (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1860
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_read</code></em>,
1861
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_write</code></em>,
1862
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1860
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_read</code></em>,
1861
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_write</code></em>,
1862
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1863
1863
<p>Shut down part of a full-duplex connection.</p>
1864
1864
<p>If <em class="parameter"><code>shutdown_read</code></em>
1865
is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the receiving side of the connection
1865
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the receiving side of the connection
1866
1866
is shut down, and further reading is disallowed.</p>
1867
1867
<p>If <em class="parameter"><code>shutdown_write</code></em>
1868
is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the sending side of the connection
1868
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the sending side of the connection
1869
1869
is shut down, and further writing is disallowed.</p>
1870
1870
<p>It is allowed for both <em class="parameter"><code>shutdown_read</code></em>
1871
1871
and <em class="parameter"><code>shutdown_write</code></em>
1872
to be <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
1872
to be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
1873
1873
<p>One example where this is used is graceful disconnect for TCP connections
1874
1874
where you close the sending side, then wait for the other side to close
1875
1875
the connection, thus ensuring that the other side saw all sent data.</p>
1945
1945
<div class="refsect2">
1946
1946
<a name="g-socket-create-source"></a><h3>g_socket_create_source ()</h3>
1947
<pre class="programlisting"><a href="../glib/glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *
1947
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *
1948
1948
g_socket_create_source (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1949
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
1949
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
1950
1950
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
1951
<p>Creates a <a href="../glib/glib-The-Main-Event-Loop.html#GSource"><code class="literal">GSource</code></a> that can be attached to a <a href="../glib/glib-The-Main-Event-Loop.html#GMainContext"><code class="literal">GMainContext</code></a> to monitor
1951
<p>Creates a <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSource"><code class="literal">GSource</code></a> that can be attached to a <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><code class="literal">GMainContext</code></a> to monitor
1952
1952
for the availability of the specified <em class="parameter"><code>condition</code></em>
1953
1953
on the socket.</p>
1954
1954
<p>The callback on the source is of the <a class="link" href="GSocket.html#GSocketSourceFunc" title="GSocketSourceFunc ()"><span class="type">GSocketSourceFunc</span></a> type.</p>
1955
<p>It is meaningless to specify <code class="literal">G_IO_ERR</code> or <code class="literal">G_IO_HUP</code> in <em class="parameter"><code>condition</code></em>
1955
<p>It is meaningless to specify <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-ERR:CAPS"><code class="literal">G_IO_ERR</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-HUP:CAPS"><code class="literal">G_IO_HUP</code></a> in <em class="parameter"><code>condition</code></em>
1957
1957
these conditions will always be reported output if they are true.</p>
1958
1958
<p><em class="parameter"><code>cancellable</code></em>
1959
if not <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> can be used to cancel the source, which will
1959
if not <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> can be used to cancel the source, which will
1960
1960
cause the source to trigger, reporting the current condition (which
1961
1961
is likely 0 unless cancellation happened at the same time as a
1962
1962
condition change). You can check for this in the callback using
1964
1964
<p>If <em class="parameter"><code>socket</code></em>
1965
1965
has a timeout set, and it is reached before <em class="parameter"><code>condition</code></em>
1967
occurs, the source will then trigger anyway, reporting <code class="literal">G_IO_IN</code> or
1968
<code class="literal">G_IO_OUT</code> depending on <em class="parameter"><code>condition</code></em>
1967
occurs, the source will then trigger anyway, reporting <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-IN:CAPS"><code class="literal">G_IO_IN</code></a> or
1968
<a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-OUT:CAPS"><code class="literal">G_IO_OUT</code></a> depending on <em class="parameter"><code>condition</code></em>
1969
1969
. However, <em class="parameter"><code>socket</code></em>
1971
1971
marked as having had a timeout, and so the next <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> I/O method
1988
1988
<td class="parameter_name"><p>condition</p></td>
1989
<td class="parameter_description"><p>a <a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> mask to monitor</p></td>
1989
<td class="parameter_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> mask to monitor</p></td>
1990
1990
<td class="parameter_annotations"> </td>
1993
1993
<td class="parameter_name"><p>cancellable</p></td>
1994
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1994
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><code class="literal">GCancellable</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
1995
1995
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
2008
2008
<div class="refsect2">
2009
2009
<a name="g-socket-condition-check"></a><h3>g_socket_condition_check ()</h3>
2010
<pre class="programlisting"><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="returnvalue">GIOCondition</span></a>
2010
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="returnvalue">GIOCondition</span></a>
2011
2011
g_socket_condition_check (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2012
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>);</pre>
2012
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>);</pre>
2013
2013
<p>Checks on the readiness of <em class="parameter"><code>socket</code></em>
2014
2014
to perform operations.
2015
2015
The operations specified in <em class="parameter"><code>condition</code></em>
2024
2024
writing to the socket if it succeeds, it is generally better to
2025
2025
simply try writing to the socket right away, and try again later if
2026
2026
the initial attempt returns <a class="link" href="gio-GIOError.html#G-IO-ERROR-WOULD-BLOCK:CAPS"><code class="literal">G_IO_ERROR_WOULD_BLOCK</code></a>.</p>
2027
<p>It is meaningless to specify <code class="literal">G_IO_ERR</code> or <code class="literal">G_IO_HUP</code> in condition;
2027
<p>It is meaningless to specify <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-ERR:CAPS"><code class="literal">G_IO_ERR</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#G-IO-HUP:CAPS"><code class="literal">G_IO_HUP</code></a> in condition;
2028
2028
these conditions will always be set in the output if they are true.</p>
2029
2029
<p>This call never blocks.</p>
2030
2030
<div class="refsect3">
2061
2061
<div class="refsect2">
2062
2062
<a name="g-socket-condition-wait"></a><h3>g_socket_condition_wait ()</h3>
2063
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2063
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2064
2064
g_socket_condition_wait (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2065
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
2065
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
2066
2066
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
2067
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2067
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2068
2068
<p>Waits for <em class="parameter"><code>condition</code></em>
2069
2069
to become true on <em class="parameter"><code>socket</code></em>
2070
2070
. When the condition
2071
is met, <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
2071
is met, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
2072
2072
<p>If <em class="parameter"><code>cancellable</code></em>
2073
2073
is cancelled before the condition is met, or if the
2074
2074
socket has a timeout set and it is reached before the condition is
2075
met, then <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em>
2076
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, is set to
2075
met, then <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em>
2076
, 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 to
2077
2077
the appropriate value (<a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> or
2078
2078
<a class="link" href="gio-GIOError.html#G-IO-ERROR-TIMED-OUT:CAPS"><code class="literal">G_IO_ERROR_TIMED_OUT</code></a>).</p>
2079
2079
<p>See also <a class="link" href="GSocket.html#g-socket-condition-timed-wait" title="g_socket_condition_timed_wait ()"><code class="function">g_socket_condition_timed_wait()</code></a>.</p>
2095
2095
<td class="parameter_name"><p>condition</p></td>
2096
<td class="parameter_description"><p>a <a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> mask to wait for</p></td>
2096
<td class="parameter_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> mask to wait for</p></td>
2097
2097
<td class="parameter_annotations"> </td>
2100
2100
<td class="parameter_name"><p>cancellable</p></td>
2101
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
2101
<td class="parameter_description"><p> 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>. </p></td>
2102
2102
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
2105
2105
<td class="parameter_name"><p>error</p></td>
2106
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
2106
<td class="parameter_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
2107
2107
<td class="parameter_annotations"> </td>
2120
2120
<div class="refsect2">
2121
2121
<a name="g-socket-condition-timed-wait"></a><h3>g_socket_condition_timed_wait ()</h3>
2122
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2122
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2123
2123
g_socket_condition_timed_wait (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2124
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
2125
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> timeout</code></em>,
2124
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
2125
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> timeout</code></em>,
2126
2126
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
2127
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2127
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2128
2128
<p>Waits for up to <em class="parameter"><code>timeout</code></em>
2129
2129
microseconds for <em class="parameter"><code>condition</code></em>
2131
2131
on <em class="parameter"><code>socket</code></em>
2132
. If the condition is met, <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
2132
. If the condition is met, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
2133
2133
<p>If <em class="parameter"><code>cancellable</code></em>
2134
2134
is cancelled before the condition is met, or if
2135
2135
<em class="parameter"><code>timeout</code></em>
2136
2136
(or the socket's <a class="link" href="GSocket.html#GSocket--timeout" title="The “timeout” property"><span class="type">“timeout”</span></a>) is reached before the
2137
condition is met, then <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em>
2138
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
2137
condition is met, then <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> is returned and <em class="parameter"><code>error</code></em>
2138
, if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
2139
2139
is set to the appropriate value (<a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a> or
2140
2140
<a class="link" href="gio-GIOError.html#G-IO-ERROR-TIMED-OUT:CAPS"><code class="literal">G_IO_ERROR_TIMED_OUT</code></a>).</p>
2141
2141
<p>If you don't want a timeout, use <a class="link" href="GSocket.html#g-socket-condition-wait" title="g_socket_condition_wait ()"><code class="function">g_socket_condition_wait()</code></a>.
2175
2175
<td class="parameter_name"><p>cancellable</p></td>
2176
<td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
2176
<td class="parameter_description"><p> 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>. </p></td>
2177
2177
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
2180
2180
<td class="parameter_name"><p>error</p></td>
2181
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
2181
<td class="parameter_description"><p>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> pointer, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
2182
2182
<td class="parameter_annotations"> </td>
2235
2235
<a name="g-socket-set-listen-backlog"></a><h3>g_socket_set_listen_backlog ()</h3>
2236
2236
<pre class="programlisting"><span class="returnvalue">void</span>
2237
2237
g_socket_set_listen_backlog (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2238
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> backlog</code></em>);</pre>
2238
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> backlog</code></em>);</pre>
2239
2239
<p>Sets the maximum number of outstanding connections allowed
2240
2240
when listening on this socket. If more clients than this are
2241
2241
connecting to the socket and the application is not handling them
2329
2329
<a name="g-socket-set-blocking"></a><h3>g_socket_set_blocking ()</h3>
2330
2330
<pre class="programlisting"><span class="returnvalue">void</span>
2331
2331
g_socket_set_blocking (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2332
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);</pre>
2332
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);</pre>
2333
2333
<p>Sets the blocking mode of the socket. In blocking mode
2334
2334
all operations block until they succeed or there is an error. In
2335
2335
non-blocking mode all functions return results immediately or
2395
2395
<a name="g-socket-set-keepalive"></a><h3>g_socket_set_keepalive ()</h3>
2396
2396
<pre class="programlisting"><span class="returnvalue">void</span>
2397
2397
g_socket_set_keepalive (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2398
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> keepalive</code></em>);</pre>
2398
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> keepalive</code></em>);</pre>
2399
2399
<p>Sets or unsets the <code class="literal">SO_KEEPALIVE</code> flag on the underlying socket. When
2400
2400
this flag is set on a socket, the system will attempt to verify that the
2401
2401
remote socket endpoint is still present if a sufficiently long period of
2467
2467
<a name="g-socket-set-timeout"></a><h3>g_socket_set_timeout ()</h3>
2468
2468
<pre class="programlisting"><span class="returnvalue">void</span>
2469
2469
g_socket_set_timeout (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2470
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> timeout</code></em>);</pre>
2470
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> timeout</code></em>);</pre>
2471
2471
<p>Sets the time in seconds after which I/O operations on <em class="parameter"><code>socket</code></em>
2473
2473
time out if they have not yet completed.</p>
2518
2518
<a name="g-socket-set-ttl"></a><h3>g_socket_set_ttl ()</h3>
2519
2519
<pre class="programlisting"><span class="returnvalue">void</span>
2520
2520
g_socket_set_ttl (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2521
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> ttl</code></em>);</pre>
2521
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> ttl</code></em>);</pre>
2522
2522
<p>Sets the time-to-live for outgoing unicast packets on <em class="parameter"><code>socket</code></em>
2524
2524
By default the platform-specific default value is used.</p>
2582
2582
<div class="refsect2">
2583
2583
<a name="g-socket-get-broadcast"></a><h3>g_socket_get_broadcast ()</h3>
2584
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2584
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2585
2585
g_socket_get_broadcast (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>);</pre>
2586
2586
<p>Gets the broadcast setting on <em class="parameter"><code>socket</code></em>
2587
; if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>,
2587
; if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>,
2588
2588
it is possible to send packets to broadcast
2590
2590
<div class="refsect3">
2615
2615
<a name="g-socket-set-broadcast"></a><h3>g_socket_set_broadcast ()</h3>
2616
2616
<pre class="programlisting"><span class="returnvalue">void</span>
2617
2617
g_socket_set_broadcast (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2618
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> broadcast</code></em>);</pre>
2618
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> broadcast</code></em>);</pre>
2619
2619
<p>Sets whether <em class="parameter"><code>socket</code></em>
2620
2620
should allow sending to broadcast addresses.
2621
This is <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> by default.</p>
2621
This is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> by default.</p>
2622
2622
<div class="refsect3">
2623
2623
<a name="id-1.4.13.2.10.38.5"></a><h4>Parameters</h4>
2624
2624
<div class="informaltable"><table width="100%" border="0">
2649
2649
<div class="refsect2">
2650
2650
<a name="g-socket-get-option"></a><h3>g_socket_get_option ()</h3>
2651
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2651
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2652
2652
g_socket_get_option (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2653
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> level</code></em>,
2654
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> optname</code></em>,
2655
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *value</code></em>,
2656
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2653
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> level</code></em>,
2654
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> optname</code></em>,
2655
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *value</code></em>,
2656
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2657
2657
<p>Gets the value of an integer-valued option on <em class="parameter"><code>socket</code></em>
2659
2659
<code class="function">getsockopt()</code>. (If you need to fetch a non-integer-valued option,
2666
2666
<p>Note that even for socket options that are a single byte in size,
2667
2667
<em class="parameter"><code>value</code></em>
2668
is still a pointer to a <a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> variable, not a <a href="../glib/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>;
2668
is still a pointer to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> variable, not a <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a>;
2669
2669
<a class="link" href="GSocket.html#g-socket-get-option" title="g_socket_get_option ()"><code class="function">g_socket_get_option()</code></a> will handle the conversion internally.</p>
2670
2670
<div class="refsect3">
2671
2671
<a name="id-1.4.13.2.10.39.7"></a><h4>Parameters</h4>
2718
2718
<div class="refsect2">
2719
2719
<a name="g-socket-set-option"></a><h3>g_socket_set_option ()</h3>
2720
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2720
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2721
2721
g_socket_set_option (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2722
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> level</code></em>,
2723
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> optname</code></em>,
2724
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> value</code></em>,
2725
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2722
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> level</code></em>,
2723
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> optname</code></em>,
2724
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> value</code></em>,
2725
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2726
2726
<p>Sets the value of an integer-valued option on <em class="parameter"><code>socket</code></em>
2728
2728
<code class="function">setsockopt()</code>. (If you need to set a non-integer-valued option,
2844
2844
<a name="g-socket-get-local-address"></a><h3>g_socket_get_local_address ()</h3>
2845
2845
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> *
2846
2846
g_socket_get_local_address (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2847
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2847
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2848
2848
<p>Try to get the local address of a bound socket. This is only
2849
2849
useful if the socket has been bound to a local address,
2850
2850
either explicitly or implicitly when connecting.</p>
2873
2873
<div class="refsect3">
2874
2874
<a name="id-1.4.13.2.10.43.6"></a><h4>Returns</h4>
2875
<p> a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
2876
Free the returned object with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
2875
<p> 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> on error.
2876
Free the returned object with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
2877
2877
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
2879
2879
<p class="since">Since 2.22</p>
2912
2912
<a name="g-socket-get-remote-address"></a><h3>g_socket_get_remote_address ()</h3>
2913
2913
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> *
2914
2914
g_socket_get_remote_address (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
2915
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2915
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2916
2916
<p>Try to get the remove address of a connected socket. This is only
2917
2917
useful for connection oriented sockets that have been connected.</p>
2918
2918
<div class="refsect3">
2940
2940
<div class="refsect3">
2941
2941
<a name="id-1.4.13.2.10.45.6"></a><h4>Returns</h4>
2942
<p> a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error.
2943
Free the returned object with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
2942
<p> 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> on error.
2943
Free the returned object with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
2944
2944
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
2946
2946
<p class="since">Since 2.22</p>
3012
3012
<a name="g-socket-get-credentials"></a><h3>g_socket_get_credentials ()</h3>
3013
3013
<pre class="programlisting"><a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> *
3014
3014
g_socket_get_credentials (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
3015
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3015
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3016
3016
<p>Returns the credentials of the foreign process connected to this
3017
3017
socket, if any (e.g. it is only supported for <a class="link" href="GSocketAddress.html#G-SOCKET-FAMILY-UNIX:CAPS"><code class="literal">G_SOCKET_FAMILY_UNIX</code></a>
3048
3048
<div class="refsect3">
3049
3049
<a name="id-1.4.13.2.10.48.8"></a><h4>Returns</h4>
3050
<p> <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em>
3050
<p> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em>
3051
3051
is set, otherwise a <a class="link" href="GCredentials.html" title="GCredentials"><span class="type">GCredentials</span></a> object
3052
that must be freed with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
3052
that must be freed with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>. </p>
3053
3053
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
3055
3055
<p class="since">Since 2.26</p>
3058
3058
<div class="refsect2">
3059
3059
<a name="g-socket-join-multicast-group"></a><h3>g_socket_join_multicast_group ()</h3>
3060
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3060
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3061
3061
g_socket_join_multicast_group (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
3062
3062
<em class="parameter"><code><a class="link" href="GInetAddress.html" title="GInetAddress"><span class="type">GInetAddress</span></a> *group</code></em>,
3063
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> source_specific</code></em>,
3064
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *iface</code></em>,
3065
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3063
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> source_specific</code></em>,
3064
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *iface</code></em>,
3065
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3066
3066
<p>Registers <em class="parameter"><code>socket</code></em>
3067
3067
to receive multicast messages sent to <em class="parameter"><code>group</code></em>
3071
3071
been bound to an appropriate interface and port with
3072
3072
<a class="link" href="GSocket.html#g-socket-bind" title="g_socket_bind ()"><code class="function">g_socket_bind()</code></a>.</p>
3073
3073
<p>If <em class="parameter"><code>iface</code></em>
3074
is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the system will automatically pick an interface
3074
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the system will automatically pick an interface
3075
3075
to bind to based on <em class="parameter"><code>group</code></em>
3077
3077
<p>If <em class="parameter"><code>source_specific</code></em>
3078
is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, source-specific multicast as defined
3078
is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, source-specific multicast as defined
3079
3079
in RFC 4604 is used. Note that on older platforms this may fail
3080
3080
with a <a class="link" href="gio-GIOError.html#G-IO-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">G_IO_ERROR_NOT_SUPPORTED</code></a> error.</p>
3081
3081
<div class="refsect3">
3101
3101
<td class="parameter_name"><p>iface</p></td>
3102
<td class="parameter_description"><p> Name of the interface to use, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
3102
<td class="parameter_description"><p> Name of the interface to use, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
3103
3103
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
3106
3106
<td class="parameter_name"><p>source_specific</p></td>
3107
<td class="parameter_description"><p><a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if source-specific multicast should be used</p></td>
3107
<td class="parameter_description"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if source-specific multicast should be used</p></td>
3108
3108
<td class="parameter_annotations"> </td>
3111
3111
<td class="parameter_name"><p>error</p></td>
3112
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
3112
<td class="parameter_description"><p><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.</p></td>
3113
3113
<td class="parameter_annotations"> </td>
3126
3126
<div class="refsect2">
3127
3127
<a name="g-socket-leave-multicast-group"></a><h3>g_socket_leave_multicast_group ()</h3>
3128
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3128
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3129
3129
g_socket_leave_multicast_group (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
3130
3130
<em class="parameter"><code><a class="link" href="GInetAddress.html" title="GInetAddress"><span class="type">GInetAddress</span></a> *group</code></em>,
3131
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> source_specific</code></em>,
3132
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *iface</code></em>,
3133
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3131
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> source_specific</code></em>,
3132
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *iface</code></em>,
3133
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3134
3134
<p>Removes <em class="parameter"><code>socket</code></em>
3135
3135
from the multicast group defined by <em class="parameter"><code>group</code></em>
3136
3136
, <em class="parameter"><code>iface</code></em>
3169
3169
<td class="parameter_name"><p>source_specific</p></td>
3170
<td class="parameter_description"><p><a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if source-specific multicast was used</p></td>
3170
<td class="parameter_description"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if source-specific multicast was used</p></td>
3171
3171
<td class="parameter_annotations"> </td>
3174
3174
<td class="parameter_name"><p>error</p></td>
3175
<td class="parameter_description"><p><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
3175
<td class="parameter_description"><p><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.</p></td>
3176
3176
<td class="parameter_annotations"> </td>
3189
3189
<div class="refsect2">
3190
3190
<a name="g-socket-get-multicast-loopback"></a><h3>g_socket_get_multicast_loopback ()</h3>
3191
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3191
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3192
3192
g_socket_get_multicast_loopback (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>);</pre>
3193
3193
<p>Gets the multicast loopback setting on <em class="parameter"><code>socket</code></em>
3194
; if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> (the
3194
; if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> (the
3195
3195
default), outgoing multicast packets will be looped back to
3196
3196
multicast listeners on the same host.</p>
3197
3197
<div class="refsect3">
3222
3222
<a name="g-socket-set-multicast-loopback"></a><h3>g_socket_set_multicast_loopback ()</h3>
3223
3223
<pre class="programlisting"><span class="returnvalue">void</span>
3224
3224
g_socket_set_multicast_loopback (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
3225
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> loopback</code></em>);</pre>
3225
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> loopback</code></em>);</pre>
3226
3226
<p>Sets whether outgoing multicast packets will be received by sockets
3227
listening on that multicast address on the same host. This is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
3227
listening on that multicast address on the same host. This is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>
3228
3228
by default.</p>
3229
3229
<div class="refsect3">
3230
3230
<a name="id-1.4.13.2.10.52.5"></a><h4>Parameters</h4>
3288
3288
<a name="g-socket-set-multicast-ttl"></a><h3>g_socket_set_multicast_ttl ()</h3>
3289
3289
<pre class="programlisting"><span class="returnvalue">void</span>
3290
3290
g_socket_set_multicast_ttl (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
3291
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> ttl</code></em>);</pre>
3291
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> ttl</code></em>);</pre>
3292
3292
<p>Sets the time-to-live for outgoing multicast datagrams on <em class="parameter"><code>socket</code></em>
3294
3294
By default, this is 1, meaning that multicast packets will not leave
3511
<td class="struct_member_name"><p><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GInputVector.buffer"></a>buffer</code></em>;</p></td>
3511
<td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> <em class="structfield"><code><a name="GInputVector.buffer"></a>buffer</code></em>;</p></td>
3512
3512
<td class="struct_member_description"><p>Pointer to a buffer where data will be written.</p></td>
3513
3513
<td class="struct_member_annotations"> </td>
3516
<td class="struct_member_name"><p><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GInputVector.size"></a>size</code></em>;</p></td>
3516
<td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GInputVector.size"></a>size</code></em>;</p></td>
3517
3517
<td class="struct_member_description"><p>the available size in <em class="parameter"><code>buffer</code></em>
3519
3519
<td class="struct_member_annotations"> </td>
3548
<td class="struct_member_name"><p><a href="../glib/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> <em class="structfield"><code><a name="GOutputVector.buffer"></a>buffer</code></em>;</p></td>
3548
<td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gconstpointer"><span class="type">gconstpointer</span></a> <em class="structfield"><code><a name="GOutputVector.buffer"></a>buffer</code></em>;</p></td>
3549
3549
<td class="struct_member_description"><p>Pointer to a buffer of data to read.</p></td>
3550
3550
<td class="struct_member_annotations"> </td>
3553
<td class="struct_member_name"><p><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GOutputVector.size"></a>size</code></em>;</p></td>
3553
<td class="struct_member_name"><p><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> <em class="structfield"><code><a name="GOutputVector.size"></a>size</code></em>;</p></td>
3554
3554
<td class="struct_member_description"><p>the size of <em class="parameter"><code>buffer</code></em>
3556
3556
<td class="struct_member_annotations"> </td>