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>
482
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
487
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
497
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
502
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a></td>
507
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
518
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
523
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
539
<td class="property_type"><a href="../glib/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="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
544
<td class="property_type"><a href="../glib/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="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
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
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="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
622
<a href="../glib/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="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.
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.
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
654
654
<a name="GSocket.functions_details"></a><h2>Functions</h2>
655
655
<div class="refsect2">
656
656
<a name="GSocketSourceFunc"></a><h3>GSocketSourceFunc ()</h3>
657
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
657
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
658
658
<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>,
659
<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>,
660
<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>
661
<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
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
660
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
661
<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>
662
662
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>
663
663
<div class="refsect3">
664
664
<a name="id-1.4.13.2.10.2.5"></a><h4>Parameters</h4>
701
701
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>,
702
702
<em class="parameter"><code><a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a> type</code></em>,
703
703
<em class="parameter"><code><a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a> protocol</code></em>,
704
<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>
704
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
705
705
<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.
706
706
If <em class="parameter"><code>protocol</code></em>
707
707
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
759
759
<div class="refsect2">
760
760
<a name="g-socket-new-from-fd"></a><h3>g_socket_new_from_fd ()</h3>
761
761
<pre class="programlisting"><a class="link" href="GSocket.html" title="GSocket"><span class="returnvalue">GSocket</span></a> *
762
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>,
763
<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>
762
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>,
763
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
764
764
<p>Creates a new <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> from a native file descriptor
765
765
or winsock SOCKET handle.</p>
766
766
<p>This reads all the settings from the file descriptor so that
801
801
<div class="refsect2">
802
802
<a name="g-socket-bind"></a><h3>g_socket_bind ()</h3>
803
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
803
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
804
804
g_socket_bind (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
805
805
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
806
<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>,
807
<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>
806
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allow_reuse</code></em>,
807
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
808
808
<p>When a socket is created it is attached to an address family, but it
809
809
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
810
810
address (sometimes called name) of the socket.</p>
815
815
<p>If <em class="parameter"><code>socket</code></em>
816
816
is a TCP socket, then <em class="parameter"><code>allow_reuse</code></em>
817
817
controls the setting
818
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
818
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
819
819
server sockets (sockets that you will eventually call
820
<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
820
<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
821
821
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
822
822
<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
823
823
immediately restarted.)</p>
872
872
<div class="refsect2">
873
873
<a name="g-socket-listen"></a><h3>g_socket_listen ()</h3>
874
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
874
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
875
875
g_socket_listen (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
876
<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>
876
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
877
877
<p>Marks the socket as a server socket, i.e. a socket that is used
878
878
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>
879
879
<p>Before calling this the socket must be bound to a local address using
915
915
<pre class="programlisting"><a class="link" href="GSocket.html" title="GSocket"><span class="returnvalue">GSocket</span></a> *
916
916
g_socket_accept (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
917
917
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
918
<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>
918
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
919
919
<p>Accept incoming connections on a connection-based socket. This removes
920
920
the first outstanding connection request from the listening socket and
921
921
creates a <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> object for it.</p>
943
943
<td class="parameter_name"><p>cancellable</p></td>
944
<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>
944
<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>
945
945
<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>
948
948
<td class="parameter_name"><p>error</p></td>
949
<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>
949
<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>
950
950
<td class="parameter_annotations"> </td>
955
955
<div class="refsect3">
956
956
<a name="id-1.4.13.2.10.7.8"></a><h4>Returns</h4>
957
<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.
958
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>
957
<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.
958
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>
959
959
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
961
961
<p class="since">Since 2.22</p>
964
964
<div class="refsect2">
965
965
<a name="g-socket-connect"></a><h3>g_socket_connect ()</h3>
966
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
966
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
967
967
g_socket_connect (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
968
968
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
969
969
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
970
<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>
970
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
971
971
<p>Connect the socket to the specified remote address.</p>
972
972
<p>For connection oriented socket this generally means we attempt to make
973
973
a connection to the <em class="parameter"><code>address</code></em>
1005
1005
<td class="parameter_name"><p>cancellable</p></td>
1006
<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>
1006
<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>
1007
1007
<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>
1010
1010
<td class="parameter_name"><p>error</p></td>
1011
<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>
1011
<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>
1012
1012
<td class="parameter_annotations"> </td>
1025
1025
<div class="refsect2">
1026
1026
<a name="g-socket-check-connect-result"></a><h3>g_socket_check_connect_result ()</h3>
1027
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1027
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1028
1028
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>,
1029
<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>
1029
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1030
1030
<p>Checks and resets the pending connect error for the socket.
1031
1031
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
1032
1032
used in non-blocking mode.</p>
1064
1064
<div class="refsect2">
1065
1065
<a name="g-socket-receive"></a><h3>g_socket_receive ()</h3>
1066
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1066
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1067
1067
g_socket_receive (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1068
<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>,
1069
<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>,
1068
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1069
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1070
1070
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1071
<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>
1071
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1072
1072
<p>Receive data (up to <em class="parameter"><code>size</code></em>
1073
1073
bytes) from a socket. This is mainly used by
1074
1074
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>
1075
1075
with <em class="parameter"><code>address</code></em>
1076
set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1076
set to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1077
1077
<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,
1078
1078
<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
1079
1079
the socket. If the received message is too large to fit in <em class="parameter"><code>buffer</code></em>
1125
1125
<td class="parameter_name"><p>cancellable</p></td>
1126
<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>
1126
<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>
1127
1127
<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>
1130
1130
<td class="parameter_name"><p>error</p></td>
1131
<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>
1131
<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>
1132
1132
<td class="parameter_annotations"> </td>
1146
1146
<div class="refsect2">
1147
1147
<a name="g-socket-receive-from"></a><h3>g_socket_receive_from ()</h3>
1148
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1148
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1149
1149
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>,
1150
1150
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> **address</code></em>,
1151
<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>,
1152
<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>,
1151
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1152
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1153
1153
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1154
<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>
1154
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1155
1155
<p>Receive data (up to <em class="parameter"><code>size</code></em>
1156
1156
bytes) from a socket.</p>
1157
1157
<p>If <em class="parameter"><code>address</code></em>
1158
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>
1158
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>
1159
1159
will be set equal to the
1160
1160
source address of the received packet.
1161
1161
<em class="parameter"><code>address</code></em>
1197
1197
<td class="parameter_name"><p>cancellable</p></td>
1198
<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>
1198
<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>
1199
1199
<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>
1202
1202
<td class="parameter_name"><p>error</p></td>
1203
<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>
1203
<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>
1204
1204
<td class="parameter_annotations"> </td>
1218
1218
<div class="refsect2">
1219
1219
<a name="g-socket-receive-message"></a><h3>g_socket_receive_message ()</h3>
1220
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1220
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1221
1221
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>,
1222
1222
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> **address</code></em>,
1223
1223
<em class="parameter"><code><a class="link" href="GSocket.html#GInputVector" title="struct GInputVector"><span class="type">GInputVector</span></a> *vectors</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> num_vectors</code></em>,
1224
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_vectors</code></em>,
1225
1225
<em class="parameter"><code><a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> ***messages</code></em>,
1226
<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>,
1227
<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>,
1226
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *num_messages</code></em>,
1227
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *flags</code></em>,
1228
1228
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1229
<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>
1229
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1230
1230
<p>Receive data from a socket. This is the most complicated and
1231
1231
fully-featured version of this call. For easier use, see
1232
1232
<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>
1233
1233
<p>If <em class="parameter"><code>address</code></em>
1234
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>
1234
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>
1235
1235
will be set equal to the
1236
1236
source address of the received packet.
1237
1237
<em class="parameter"><code>address</code></em>
1244
1244
If <em class="parameter"><code>num_vectors</code></em>
1245
1245
is -1, then <em class="parameter"><code>vectors</code></em>
1246
1246
is assumed to be terminated
1247
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>
1247
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>
1248
1248
<p>As a special case, if <em class="parameter"><code>num_vectors</code></em>
1249
1249
is 0 (in which case, <em class="parameter"><code>vectors</code></em>
1251
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
1251
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
1252
1252
discarded. This is to facilitate the common practice of sending a
1253
1253
single '\0' byte for the purposes of transferring ancillary data.</p>
1254
1254
<p><em class="parameter"><code>messages</code></em>
1255
, 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
1256
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
1255
, 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
1256
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
1257
1257
messages was received. These correspond to the control messages
1258
1258
received from the kernel, one <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> per message
1259
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
1260
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
1259
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
1260
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
1261
1261
element. If <em class="parameter"><code>messages</code></em>
1262
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
1262
is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, any control messages received will
1263
1263
be discarded.</p>
1264
1264
<p><em class="parameter"><code>num_messages</code></em>
1265
, 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
1265
, 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
1266
1266
messages received.</p>
1267
1267
<p>If both <em class="parameter"><code>messages</code></em>
1268
1268
and <em class="parameter"><code>num_messages</code></em>
1269
are non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then
1269
are non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then
1270
1270
<em class="parameter"><code>num_messages</code></em>
1271
1271
gives the number of <a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> instances
1272
1272
in <em class="parameter"><code>messages</code></em>
1273
(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>
1273
(ie: not including the <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> terminator).</p>
1274
1274
<p><em class="parameter"><code>flags</code></em>
1275
1275
is an in/out parameter. The commonly available arguments
1276
1276
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
1329
1329
<td class="parameter_name"><p>messages</p></td>
1330
1330
<td class="parameter_description"><p> a pointer which
1331
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>
1331
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>
1332
1332
<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>
1335
1335
<td class="parameter_name"><p>num_messages</p></td>
1336
1336
<td class="parameter_description"><p>a pointer which will be filled with the number of
1337
1337
elements in <em class="parameter"><code>messages</code></em>
1338
, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1338
, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
1339
1339
<td class="parameter_annotations"> </td>
1347
1347
<td class="parameter_name"><p>cancellable</p></td>
1348
<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>
1348
<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>
1349
1349
<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>
1352
1352
<td class="parameter_name"><p>error</p></td>
1353
<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>
1353
<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>
1354
1354
<td class="parameter_annotations"> </td>
1368
1368
<div class="refsect2">
1369
1369
<a name="g-socket-receive-with-blocking"></a><h3>g_socket_receive_with_blocking ()</h3>
1370
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1370
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1371
1371
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>,
1372
<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>,
1373
<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>,
1374
<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
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1373
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1374
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>,
1375
1375
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1376
<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>
1376
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1377
1377
<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
1378
1378
the choice of blocking or non-blocking behavior is determined by
1379
1379
the <em class="parameter"><code>blocking</code></em>
1414
1414
<td class="parameter_name"><p>cancellable</p></td>
1415
<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>
1415
<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>
1416
1416
<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>
1419
1419
<td class="parameter_name"><p>error</p></td>
1420
<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>
1420
<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>
1421
1421
<td class="parameter_annotations"> </td>
1435
1435
<div class="refsect2">
1436
1436
<a name="g-socket-send"></a><h3>g_socket_send ()</h3>
1437
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1437
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1438
1438
g_socket_send (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1439
<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>,
1440
<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>,
1439
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1440
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1441
1441
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1442
<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>
1442
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1443
1443
<p>Tries to send <em class="parameter"><code>size</code></em>
1444
1444
bytes from <em class="parameter"><code>buffer</code></em>
1445
1445
on the socket. This is
1446
1446
mainly used by connection-oriented sockets; it is identical to
1447
1447
<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>
1448
set to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1448
set to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
1449
1449
<p>If the socket is in blocking mode the call will block until there is
1450
1450
space for the data in the socket queue. If there is no space available
1451
1451
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
1485
1485
<td class="parameter_name"><p>cancellable</p></td>
1486
<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>
1486
<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>
1487
1487
<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>
1490
1490
<td class="parameter_name"><p>error</p></td>
1491
<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>
1491
<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>
1492
1492
<td class="parameter_annotations"> </td>
1507
1507
<div class="refsect2">
1508
1508
<a name="g-socket-send-to"></a><h3>g_socket_send_to ()</h3>
1509
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1509
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1510
1510
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>,
1511
1511
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
1512
<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>,
1513
<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>,
1512
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1513
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1514
1514
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1515
<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>
1515
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1516
1516
<p>Tries to send <em class="parameter"><code>size</code></em>
1517
1517
bytes from <em class="parameter"><code>buffer</code></em>
1518
1518
to <em class="parameter"><code>address</code></em>
1519
1519
. If <em class="parameter"><code>address</code></em>
1521
<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
1521
<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
1522
1522
<a class="link" href="GSocket.html#g-socket-connect" title="g_socket_connect ()"><code class="function">g_socket_connect()</code></a>).</p>
1523
1523
<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>
1524
1524
<div class="refsect3">
1555
1555
<td class="parameter_name"><p>cancellable</p></td>
1556
<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>
1556
<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>
1557
1557
<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>
1560
1560
<td class="parameter_name"><p>error</p></td>
1561
<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>
1561
<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>
1562
1562
<td class="parameter_annotations"> </td>
1577
1577
<div class="refsect2">
1578
1578
<a name="g-socket-send-message"></a><h3>g_socket_send_message ()</h3>
1579
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1579
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1580
1580
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>,
1581
1581
<em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>,
1582
1582
<em class="parameter"><code><a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> *vectors</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> num_vectors</code></em>,
1583
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_vectors</code></em>,
1584
1584
<em class="parameter"><code><a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> **messages</code></em>,
1585
<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>,
1586
<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>,
1585
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> num_messages</code></em>,
1586
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> flags</code></em>,
1587
1587
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1588
<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>
1588
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1589
1589
<p>Send data to <em class="parameter"><code>address</code></em>
1590
1590
on <em class="parameter"><code>socket</code></em>
1591
1591
. This is the most complicated and
1592
1592
fully-featured version of this call. For easier use, see
1593
1593
<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>
1594
1594
<p>If <em class="parameter"><code>address</code></em>
1595
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
1595
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
1596
1596
(set by <a class="link" href="GSocket.html#g-socket-connect" title="g_socket_connect ()"><code class="function">g_socket_connect()</code></a>).</p>
1597
1597
<p><em class="parameter"><code>vectors</code></em>
1598
1598
must point to an array of <a class="link" href="GSocket.html#GOutputVector" title="struct GOutputVector"><span class="type">GOutputVector</span></a> structs and
1602
1602
then <em class="parameter"><code>vectors</code></em>
1603
1603
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
1604
<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
1604
<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
1605
1605
that the sent data will be gathered from. Using multiple
1606
1606
<a href="GSocket.html#GOutputVector"><span class="type">GOutputVectors</span></a> is more memory-efficient than manually copying
1607
1607
data from multiple sources into a single buffer, and more
1608
1608
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>
1609
1609
<p><em class="parameter"><code>messages</code></em>
1610
, 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>
1610
, 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>
1612
1612
<a class="link" href="GSocketControlMessage.html" title="GSocketControlMessage"><span class="type">GSocketControlMessage</span></a> instances. These correspond to the control
1613
1613
messages to be sent on the socket.
1614
1614
If <em class="parameter"><code>num_messages</code></em>
1615
1615
is -1 then <em class="parameter"><code>messages</code></em>
1616
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
1616
is treated as a <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated
1618
1618
<p><em class="parameter"><code>flags</code></em>
1619
1619
modify how the message is sent. The commonly available arguments
1681
1681
<td class="parameter_name"><p>cancellable</p></td>
1682
<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>
1682
<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>
1683
1683
<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>
1686
1686
<td class="parameter_name"><p>error</p></td>
1687
<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>
1687
<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>
1688
1688
<td class="parameter_annotations"> </td>
1703
1703
<div class="refsect2">
1704
1704
<a name="g-socket-send-with-blocking"></a><h3>g_socket_send_with_blocking ()</h3>
1705
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1705
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gssize"><span class="returnvalue">gssize</span></a>
1706
1706
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>,
1707
<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>,
1708
<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>,
1709
<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
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
1708
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> size</code></em>,
1709
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>,
1710
1710
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
1711
<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>
1711
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1712
1712
<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
1713
1713
the choice of blocking or non-blocking behavior is determined by
1714
1714
the <em class="parameter"><code>blocking</code></em>
1748
1748
<td class="parameter_name"><p>cancellable</p></td>
1749
<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>
1749
<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>
1750
1750
<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>
1753
1753
<td class="parameter_name"><p>error</p></td>
1754
<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>
1754
<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>
1755
1755
<td class="parameter_annotations"> </td>
1770
1770
<div class="refsect2">
1771
1771
<a name="g-socket-close"></a><h3>g_socket_close ()</h3>
1772
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1772
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1773
1773
g_socket_close (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1774
<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>
1774
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1775
1775
<p>Closes the socket, shutting down any active connection.</p>
1776
1776
<p>Closing a socket does not wait for all outstanding I/O operations
1777
1777
to finish, so the caller should not rely on them to be guaranteed
1859
1859
<div class="refsect2">
1860
1860
<a name="g-socket-shutdown"></a><h3>g_socket_shutdown ()</h3>
1861
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1861
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
1862
1862
g_socket_shutdown (<em class="parameter"><code><a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> *socket</code></em>,
1863
<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>,
1864
<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>,
1865
<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
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_read</code></em>,
1864
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> shutdown_write</code></em>,
1865
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
1866
1866
<p>Shut down part of a full-duplex connection.</p>
1867
1867
<p>If <em class="parameter"><code>shutdown_read</code></em>
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 receiving side of the connection
1868
is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the receiving side of the connection
1869
1869
is shut down, and further reading is disallowed.</p>
1870
1870
<p>If <em class="parameter"><code>shutdown_write</code></em>
1871
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
1871
is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> then the sending side of the connection
1872
1872
is shut down, and further writing is disallowed.</p>
1873
1873
<p>It is allowed for both <em class="parameter"><code>shutdown_read</code></em>
1874
1874
and <em class="parameter"><code>shutdown_write</code></em>
1875
to be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
1875
to be <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.</p>
1876
1876
<p>One example where this is used is graceful disconnect for TCP connections
1877
1877
where you close the sending side, then wait for the other side to close
1878
1878
the connection, thus ensuring that the other side saw all sent data.</p>
1948
1948
<div class="refsect2">
1949
1949
<a name="g-socket-create-source"></a><h3>g_socket_create_source ()</h3>
1950
<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> *
1950
<pre class="programlisting"><a href="../glib/glib-The-Main-Event-Loop.html#GSource"><span class="returnvalue">GSource</span></a> *
1951
1951
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>,
1952
<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>,
1952
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
1953
1953
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>);</pre>
1954
<p>Creates a <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></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
1954
<p>Creates a <a href="../glib/glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></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
1955
1955
for the availability of the specified <em class="parameter"><code>condition</code></em>
1956
on the socket. The <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a>
1956
on the socket. The <a href="../glib/glib-The-Main-Event-Loop.html#GSource"><span class="type">GSource</span></a>
1957
1957
keeps a reference to the <em class="parameter"><code>socket</code></em>
1959
1959
<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>
1962
1962
these conditions will always be reported output if they are true.</p>
1963
1963
<p><em class="parameter"><code>cancellable</code></em>
1964
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
1964
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
1965
1965
cause the source to trigger, reporting the current condition (which
1966
1966
is likely 0 unless cancellation happened at the same time as a
1967
1967
condition change). You can check for this in the callback using
1993
1993
<td class="parameter_name"><p>condition</p></td>
1994
<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>
1994
<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>
1995
1995
<td class="parameter_annotations"> </td>
1998
1998
<td class="parameter_name"><p>cancellable</p></td>
1999
<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>
1999
<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>
2000
2000
<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>
2013
2013
<div class="refsect2">
2014
2014
<a name="g-socket-condition-check"></a><h3>g_socket_condition_check ()</h3>
2015
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#GIOCondition"><span class="returnvalue">GIOCondition</span></a>
2015
<pre class="programlisting"><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="returnvalue">GIOCondition</span></a>
2016
2016
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>,
2017
<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>
2017
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>);</pre>
2018
2018
<p>Checks on the readiness of <em class="parameter"><code>socket</code></em>
2019
2019
to perform operations.
2020
2020
The operations specified in <em class="parameter"><code>condition</code></em>
2066
2066
<div class="refsect2">
2067
2067
<a name="g-socket-condition-wait"></a><h3>g_socket_condition_wait ()</h3>
2068
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2068
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2069
2069
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>,
2070
<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>,
2070
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
2071
2071
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
2072
<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>
2072
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2073
2073
<p>Waits for <em class="parameter"><code>condition</code></em>
2074
2074
to become true on <em class="parameter"><code>socket</code></em>
2075
2075
. When the condition
2076
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>
2076
is met, <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
2077
2077
<p>If <em class="parameter"><code>cancellable</code></em>
2078
2078
is cancelled before the condition is met, or if the
2079
2079
socket has a timeout set and it is reached before the condition is
2080
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>
2081
, 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
2080
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>
2081
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, is set to
2082
2082
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
2083
2083
<a class="link" href="gio-GIOError.html#G-IO-ERROR-TIMED-OUT:CAPS"><code class="literal">G_IO_ERROR_TIMED_OUT</code></a>).</p>
2084
2084
<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>
2100
2100
<td class="parameter_name"><p>condition</p></td>
2101
<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>
2101
<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>
2102
2102
<td class="parameter_annotations"> </td>
2105
2105
<td class="parameter_name"><p>cancellable</p></td>
2106
<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>
2106
<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>
2107
2107
<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>
2110
2110
<td class="parameter_name"><p>error</p></td>
2111
<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>
2111
<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>
2112
2112
<td class="parameter_annotations"> </td>
2125
2125
<div class="refsect2">
2126
2126
<a name="g-socket-condition-timed-wait"></a><h3>g_socket_condition_timed_wait ()</h3>
2127
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2127
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2128
2128
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>,
2129
<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>,
2130
<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>,
2129
<em class="parameter"><code><a href="../glib/glib-IO-Channels.html#GIOCondition"><span class="type">GIOCondition</span></a> condition</code></em>,
2130
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> timeout</code></em>,
2131
2131
<em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
2132
<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>
2132
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2133
2133
<p>Waits for up to <em class="parameter"><code>timeout</code></em>
2134
2134
microseconds for <em class="parameter"><code>condition</code></em>
2136
2136
on <em class="parameter"><code>socket</code></em>
2137
. 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>
2137
. If the condition is met, <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> is returned.</p>
2138
2138
<p>If <em class="parameter"><code>cancellable</code></em>
2139
2139
is cancelled before the condition is met, or if
2140
2140
<em class="parameter"><code>timeout</code></em>
2141
2141
(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
2142
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>
2143
, if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
2142
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>
2143
, if non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>,
2144
2144
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
2145
2145
<a class="link" href="gio-GIOError.html#G-IO-ERROR-TIMED-OUT:CAPS"><code class="literal">G_IO_ERROR_TIMED_OUT</code></a>).</p>
2146
2146
<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>.
2180
2180
<td class="parameter_name"><p>cancellable</p></td>
2181
<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>
2181
<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>
2182
2182
<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>
2185
2185
<td class="parameter_name"><p>error</p></td>
2186
<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>
2186
<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>
2187
2187
<td class="parameter_annotations"> </td>
2240
2240
<a name="g-socket-set-listen-backlog"></a><h3>g_socket_set_listen_backlog ()</h3>
2241
2241
<pre class="programlisting"><span class="returnvalue">void</span>
2242
2242
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>,
2243
<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>
2243
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> backlog</code></em>);</pre>
2244
2244
<p>Sets the maximum number of outstanding connections allowed
2245
2245
when listening on this socket. If more clients than this are
2246
2246
connecting to the socket and the application is not handling them
2334
2334
<a name="g-socket-set-blocking"></a><h3>g_socket_set_blocking ()</h3>
2335
2335
<pre class="programlisting"><span class="returnvalue">void</span>
2336
2336
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>,
2337
<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>
2337
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);</pre>
2338
2338
<p>Sets the blocking mode of the socket. In blocking mode
2339
2339
all operations block until they succeed or there is an error. In
2340
2340
non-blocking mode all functions return results immediately or
2400
2400
<a name="g-socket-set-keepalive"></a><h3>g_socket_set_keepalive ()</h3>
2401
2401
<pre class="programlisting"><span class="returnvalue">void</span>
2402
2402
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>,
2403
<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>
2403
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> keepalive</code></em>);</pre>
2404
2404
<p>Sets or unsets the <code class="literal">SO_KEEPALIVE</code> flag on the underlying socket. When
2405
2405
this flag is set on a socket, the system will attempt to verify that the
2406
2406
remote socket endpoint is still present if a sufficiently long period of
2472
2472
<a name="g-socket-set-timeout"></a><h3>g_socket_set_timeout ()</h3>
2473
2473
<pre class="programlisting"><span class="returnvalue">void</span>
2474
2474
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>,
2475
<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>
2475
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> timeout</code></em>);</pre>
2476
2476
<p>Sets the time in seconds after which I/O operations on <em class="parameter"><code>socket</code></em>
2478
2478
time out if they have not yet completed.</p>
2523
2523
<a name="g-socket-set-ttl"></a><h3>g_socket_set_ttl ()</h3>
2524
2524
<pre class="programlisting"><span class="returnvalue">void</span>
2525
2525
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>,
2526
<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>
2526
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> ttl</code></em>);</pre>
2527
2527
<p>Sets the time-to-live for outgoing unicast packets on <em class="parameter"><code>socket</code></em>
2529
2529
By default the platform-specific default value is used.</p>
2587
2587
<div class="refsect2">
2588
2588
<a name="g-socket-get-broadcast"></a><h3>g_socket_get_broadcast ()</h3>
2589
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2589
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2590
2590
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>
2591
2591
<p>Gets the broadcast setting on <em class="parameter"><code>socket</code></em>
2592
; if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>,
2592
; if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>,
2593
2593
it is possible to send packets to broadcast
2595
2595
<div class="refsect3">
2620
2620
<a name="g-socket-set-broadcast"></a><h3>g_socket_set_broadcast ()</h3>
2621
2621
<pre class="programlisting"><span class="returnvalue">void</span>
2622
2622
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>,
2623
<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>
2623
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> broadcast</code></em>);</pre>
2624
2624
<p>Sets whether <em class="parameter"><code>socket</code></em>
2625
2625
should allow sending to broadcast addresses.
2626
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>
2626
This is <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> by default.</p>
2627
2627
<div class="refsect3">
2628
2628
<a name="id-1.4.13.2.10.38.5"></a><h4>Parameters</h4>
2629
2629
<div class="informaltable"><table width="100%" border="0">
2654
2654
<div class="refsect2">
2655
2655
<a name="g-socket-get-option"></a><h3>g_socket_get_option ()</h3>
2656
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2656
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2657
2657
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>,
2658
<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>,
2659
<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>,
2660
<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>,
2661
<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>
2658
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> level</code></em>,
2659
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> optname</code></em>,
2660
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *value</code></em>,
2661
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2662
2662
<p>Gets the value of an integer-valued option on <em class="parameter"><code>socket</code></em>
2664
2664
<code class="function">getsockopt()</code>. (If you need to fetch a non-integer-valued option,
2671
2671
<p>Note that even for socket options that are a single byte in size,
2672
2672
<em class="parameter"><code>value</code></em>
2673
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>;
2673
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>;
2674
2674
<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>
2675
2675
<div class="refsect3">
2676
2676
<a name="id-1.4.13.2.10.39.7"></a><h4>Parameters</h4>
2723
2723
<div class="refsect2">
2724
2724
<a name="g-socket-set-option"></a><h3>g_socket_set_option ()</h3>
2725
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2725
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
2726
2726
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>,
2727
<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>,
2728
<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>,
2729
<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>,
2730
<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>
2727
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> level</code></em>,
2728
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> optname</code></em>,
2729
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> value</code></em>,
2730
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2731
2731
<p>Sets the value of an integer-valued option on <em class="parameter"><code>socket</code></em>
2733
2733
<code class="function">setsockopt()</code>. (If you need to set a non-integer-valued option,
2849
2849
<a name="g-socket-get-local-address"></a><h3>g_socket_get_local_address ()</h3>
2850
2850
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> *
2851
2851
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>,
2852
<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>
2852
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2853
2853
<p>Try to get the local address of a bound socket. This is only
2854
2854
useful if the socket has been bound to a local address,
2855
2855
either explicitly or implicitly when connecting.</p>
2878
2878
<div class="refsect3">
2879
2879
<a name="id-1.4.13.2.10.43.6"></a><h4>Returns</h4>
2880
<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.
2881
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>
2880
<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.
2881
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>
2882
2882
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
2884
2884
<p class="since">Since 2.22</p>
2917
2917
<a name="g-socket-get-remote-address"></a><h3>g_socket_get_remote_address ()</h3>
2918
2918
<pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> *
2919
2919
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>,
2920
<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>
2920
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
2921
2921
<p>Try to get the remove address of a connected socket. This is only
2922
2922
useful for connection oriented sockets that have been connected.</p>
2923
2923
<div class="refsect3">
2945
2945
<div class="refsect3">
2946
2946
<a name="id-1.4.13.2.10.45.6"></a><h4>Returns</h4>
2947
<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.
2948
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>
2947
<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.
2948
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>
2949
2949
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
2951
2951
<p class="since">Since 2.22</p>
3017
3017
<a name="g-socket-get-credentials"></a><h3>g_socket_get_credentials ()</h3>
3018
3018
<pre class="programlisting"><a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> *
3019
3019
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>,
3020
<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>
3020
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3021
3021
<p>Returns the credentials of the foreign process connected to this
3022
3022
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>
3053
3053
<div class="refsect3">
3054
3054
<a name="id-1.4.13.2.10.48.8"></a><h4>Returns</h4>
3055
<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>
3055
<p> <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em>
3056
3056
is set, otherwise a <a class="link" href="GCredentials.html" title="GCredentials"><span class="type">GCredentials</span></a> object
3057
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>
3057
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>
3058
3058
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
3060
3060
<p class="since">Since 2.26</p>
3063
3063
<div class="refsect2">
3064
3064
<a name="g-socket-join-multicast-group"></a><h3>g_socket_join_multicast_group ()</h3>
3065
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3065
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3066
3066
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>,
3067
3067
<em class="parameter"><code><a class="link" href="GInetAddress.html" title="GInetAddress"><span class="type">GInetAddress</span></a> *group</code></em>,
3068
<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>,
3069
<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>,
3070
<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>
3068
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> source_specific</code></em>,
3069
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *iface</code></em>,
3070
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3071
3071
<p>Registers <em class="parameter"><code>socket</code></em>
3072
3072
to receive multicast messages sent to <em class="parameter"><code>group</code></em>
3076
3076
been bound to an appropriate interface and port with
3077
3077
<a class="link" href="GSocket.html#g-socket-bind" title="g_socket_bind ()"><code class="function">g_socket_bind()</code></a>.</p>
3078
3078
<p>If <em class="parameter"><code>iface</code></em>
3079
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
3079
is <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, the system will automatically pick an interface
3080
3080
to bind to based on <em class="parameter"><code>group</code></em>
3082
3082
<p>If <em class="parameter"><code>source_specific</code></em>
3083
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
3083
is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, source-specific multicast as defined
3084
3084
in RFC 4604 is used. Note that on older platforms this may fail
3085
3085
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>
3086
3086
<div class="refsect3">
3106
3106
<td class="parameter_name"><p>iface</p></td>
3107
<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>
3107
<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>
3108
3108
<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>
3111
3111
<td class="parameter_name"><p>source_specific</p></td>
3112
<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>
3112
<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>
3113
3113
<td class="parameter_annotations"> </td>
3116
3116
<td class="parameter_name"><p>error</p></td>
3117
<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>
3117
<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>
3118
3118
<td class="parameter_annotations"> </td>
3131
3131
<div class="refsect2">
3132
3132
<a name="g-socket-leave-multicast-group"></a><h3>g_socket_leave_multicast_group ()</h3>
3133
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3133
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3134
3134
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>,
3135
3135
<em class="parameter"><code><a class="link" href="GInetAddress.html" title="GInetAddress"><span class="type">GInetAddress</span></a> *group</code></em>,
3136
<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>,
3137
<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>,
3138
<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>
3136
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> source_specific</code></em>,
3137
<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *iface</code></em>,
3138
<em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
3139
3139
<p>Removes <em class="parameter"><code>socket</code></em>
3140
3140
from the multicast group defined by <em class="parameter"><code>group</code></em>
3141
3141
, <em class="parameter"><code>iface</code></em>
3174
3174
<td class="parameter_name"><p>source_specific</p></td>
3175
<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>
3175
<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>
3176
3176
<td class="parameter_annotations"> </td>
3179
3179
<td class="parameter_name"><p>error</p></td>
3180
<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>
3180
<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>
3181
3181
<td class="parameter_annotations"> </td>
3194
3194
<div class="refsect2">
3195
3195
<a name="g-socket-get-multicast-loopback"></a><h3>g_socket_get_multicast_loopback ()</h3>
3196
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3196
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
3197
3197
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>
3198
3198
<p>Gets the multicast loopback setting on <em class="parameter"><code>socket</code></em>
3199
; if <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> (the
3199
; if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> (the
3200
3200
default), outgoing multicast packets will be looped back to
3201
3201
multicast listeners on the same host.</p>
3202
3202
<div class="refsect3">
3227
3227
<a name="g-socket-set-multicast-loopback"></a><h3>g_socket_set_multicast_loopback ()</h3>
3228
3228
<pre class="programlisting"><span class="returnvalue">void</span>
3229
3229
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>,
3230
<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>
3230
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> loopback</code></em>);</pre>
3231
3231
<p>Sets whether outgoing multicast packets will be received by sockets
3232
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>
3232
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>
3233
3233
by default.</p>
3234
3234
<div class="refsect3">
3235
3235
<a name="id-1.4.13.2.10.52.5"></a><h4>Parameters</h4>
3293
3293
<a name="g-socket-set-multicast-ttl"></a><h3>g_socket_set_multicast_ttl ()</h3>
3294
3294
<pre class="programlisting"><span class="returnvalue">void</span>
3295
3295
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>,
3296
<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>
3296
<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> ttl</code></em>);</pre>
3297
3297
<p>Sets the time-to-live for outgoing multicast datagrams on <em class="parameter"><code>socket</code></em>
3299
3299
By default, this is 1, meaning that multicast packets will not leave
3516
<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>
3516
<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>
3517
3517
<td class="struct_member_description"><p>Pointer to a buffer where data will be written.</p></td>
3518
3518
<td class="struct_member_annotations"> </td>
3521
<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>
3521
<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>
3522
3522
<td class="struct_member_description"><p>the available size in <em class="parameter"><code>buffer</code></em>
3524
3524
<td class="struct_member_annotations"> </td>
3553
<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>
3553
<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>
3554
3554
<td class="struct_member_description"><p>Pointer to a buffer of data to read.</p></td>
3555
3555
<td class="struct_member_annotations"> </td>
3558
<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>
3558
<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>
3559
3559
<td class="struct_member_description"><p>the size of <em class="parameter"><code>buffer</code></em>
3561
3561
<td class="struct_member_annotations"> </td>