93
93
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1SocketListener.html#a59491f0159709ed08cd71c55cb738def">add_inet_port</a> (guint16 port)</td></tr>
94
94
<tr><td class="mdescLeft"> </td><td class="mdescRight">Helper function for g_socket_listener_add_address() that creates a TCP/IP socket listening on IPv4 and IPv6 (if supported) on the specified port on all interfaces. <a href="#a59491f0159709ed08cd71c55cb738def"></a><br/></td></tr>
95
95
<tr><td class="memItemLeft" align="right" valign="top">guint16 </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1SocketListener.html#a7639ca25eb3efe301ba08df635c2fc37">add_any_inet_port</a> (const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& source_object)</td></tr>
96
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each are available). <a href="#a7639ca25eb3efe301ba08df635c2fc37"></a><br/></td></tr>
96
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each is available). <a href="#a7639ca25eb3efe301ba08df635c2fc37"></a><br/></td></tr>
97
97
<tr><td class="memItemLeft" align="right" valign="top">guint16 </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1SocketListener.html#a8cf1d0491124ef2eb40de9a4392e973b">add_any_inet_port</a> ()</td></tr>
98
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each are available). <a href="#a8cf1d0491124ef2eb40de9a4392e973b"></a><br/></td></tr>
98
<tr><td class="mdescLeft"> </td><td class="mdescRight">Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each is available). <a href="#a8cf1d0491124ef2eb40de9a4392e973b"></a><br/></td></tr>
99
99
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1Socket.html">Socket</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1SocketListener.html#a5a9657d9840d3e9d85efb406bb2393d2">accept_socket</a> (<a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& source_object, const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1Cancellable.html">Cancellable</a> >& cancellable)</td></tr>
100
100
<tr><td class="mdescLeft"> </td><td class="mdescRight">Blocks waiting for a client to connect to any of the sockets added to the listener. <a href="#a5a9657d9840d3e9d85efb406bb2393d2"></a><br/></td></tr>
101
101
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1Socket.html">Socket</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1SocketListener.html#a3e79b5b10555b73e4359671cdb53e038">accept_socket</a> (<a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& source_object)</td></tr>
153
153
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classGio_1_1ThreadedSocketService.html" title="A threaded GSocketService.">ThreadedSocketService</a>, <a class="el" href="classGio_1_1SocketService.html" title="Make it easy to implement a network service.">SocketService</a>.</dd></dl>
154
154
<p>A <a class="el" href="classGio_1_1SocketListener.html" title="Helper for accepting network client connections.">SocketListener</a> is an object that keeps track of a set of server sockets and helps you accept sockets from any of the socket, either sync or async.</p>
155
155
<p>If you want to implement a network server, also look at <a class="el" href="classGio_1_1SocketService.html" title="Make it easy to implement a network service.">SocketService</a> and <a class="el" href="classGio_1_1ThreadedSocketService.html" title="A threaded GSocketService.">ThreadedSocketService</a> which are subclass of <a class="el" href="classGio_1_1SocketListener.html" title="Helper for accepting network client connections.">SocketListener</a> that makes this even easier.</p>
156
<dl class="since_2_24"><dt><b><a class="el" href="since_2_24.html#_since_2_24000033">Since glibmm 2.24:</a></b></dt><dd></dd></dl>
156
<dl class="since_2_24"><dt><b><a class="el" href="since_2_24.html#_since_2_24000035">Since glibmm 2.24:</a></b></dt><dd></dd></dl>
157
157
</div><hr/><h2>Constructor & Destructor Documentation</h2>
158
158
<a class="anchor" id="a72cc482888057f1e6747309e382ae669"></a><!-- doxytag: member="Gio::SocketListener::~SocketListener" ref="a72cc482888057f1e6747309e382ae669" args="()" -->
159
159
<div class="memitem">
217
217
<p>Returns a <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a> for the socket that was accepted.</p>
218
218
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
219
219
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
220
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000160">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
220
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000161">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
221
221
<dl><dt><b>Parameters:</b></dt><dd>
222
222
<table class="params">
223
223
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
248
248
<p>Returns a <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a> for the socket that was accepted.</p>
249
249
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
250
250
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
251
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000161">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
251
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000162">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
252
252
<dl><dt><b>Parameters:</b></dt><dd>
253
253
<table class="params">
254
254
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
279
279
<p>Returns a <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a> for the socket that was accepted.</p>
280
280
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
281
281
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
282
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000162">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
282
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000163">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
283
283
<dl><dt><b>Parameters:</b></dt><dd>
284
284
<table class="params">
285
285
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
309
309
<p>Returns a <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a> for the socket that was accepted.</p>
310
310
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
311
311
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
312
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000163">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
312
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000164">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
313
313
<dl><dt><b>Parameters:</b></dt><dd>
314
314
<table class="params">
315
315
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
476
476
<p>If you want to accept the high-level <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a>, not a <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>, which is often the case, then you should use g_socket_listener_accept() instead.</p>
477
477
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
478
478
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
479
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000155">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
479
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000156">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
480
480
<dl><dt><b>Parameters:</b></dt><dd>
481
481
<table class="params">
482
482
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
518
518
<p>If you want to accept the high-level <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a>, not a <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>, which is often the case, then you should use g_socket_listener_accept() instead.</p>
519
519
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
520
520
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
521
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000152">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
521
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000153">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
522
522
<dl><dt><b>Parameters:</b></dt><dd>
523
523
<table class="params">
524
524
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
550
550
<p>If you want to accept the high-level <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a>, not a <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>, which is often the case, then you should use g_socket_listener_accept() instead.</p>
551
551
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
552
552
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
553
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000155">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
554
<dl><dt><b>Parameters:</b></dt><dd>
555
<table class="params">
556
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
557
<tr><td class="paramname">cancellable</td><td>Optional <a class="el" href="classGio_1_1Cancellable.html" title="Allows actions to be cancelled.">Cancellable</a> object, <code>0</code> to ignore. </td></tr>
561
<dl class="return"><dt><b>Returns:</b></dt><dd>A <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a> on success, <code>0</code> on error. </dd></dl>
565
<a class="anchor" id="a3e79b5b10555b73e4359671cdb53e038"></a><!-- doxytag: member="Gio::SocketListener::accept_socket" ref="a3e79b5b10555b73e4359671cdb53e038" args="(Glib::RefPtr< Glib::Object > &source_object)" -->
566
<div class="memitem">
567
<div class="memproto">
568
<table class="memname">
570
<td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Socket.html">Socket</a>> Gio::SocketListener::accept_socket </td>
572
<td class="paramtype"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& </td>
573
<td class="paramname"><em>source_object</em></td><td>)</td>
580
<p>Blocks waiting for a client to connect to any of the sockets added to the listener. </p>
581
<p>Returns the <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a> that was accepted.</p>
582
<p>If you want to accept the high-level <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a>, not a <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>, which is often the case, then you should use g_socket_listener_accept() instead.</p>
583
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
584
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
553
585
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000154">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
554
586
<dl><dt><b>Parameters:</b></dt><dd>
555
587
<table class="params">
565
<a class="anchor" id="a3e79b5b10555b73e4359671cdb53e038"></a><!-- doxytag: member="Gio::SocketListener::accept_socket" ref="a3e79b5b10555b73e4359671cdb53e038" args="(Glib::RefPtr< Glib::Object > &source_object)" -->
566
<div class="memitem">
567
<div class="memproto">
568
<table class="memname">
570
<td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Socket.html">Socket</a>> Gio::SocketListener::accept_socket </td>
572
<td class="paramtype"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& </td>
573
<td class="paramname"><em>source_object</em></td><td>)</td>
580
<p>Blocks waiting for a client to connect to any of the sockets added to the listener. </p>
581
<p>Returns the <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a> that was accepted.</p>
582
<p>If you want to accept the high-level <a class="el" href="classGio_1_1SocketConnection.html" title="A socket connection.">SocketConnection</a>, not a <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>, which is often the case, then you should use g_socket_listener_accept() instead.</p>
583
<p>If <em>source_object</em> is not <code>0</code> it will be filled out with the source object specified when the corresponding socket or address was added to the listener.</p>
584
<p>If <em>cancellable</em> is not <code>0</code>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error IO_ERROR_CANCELLED will be returned.</p>
585
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000153">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
586
<dl><dt><b>Parameters:</b></dt><dd>
587
<table class="params">
588
<tr><td class="paramname">source_object</td><td>Location where Object pointer will be stored, or <code>0</code>. </td></tr>
589
<tr><td class="paramname">cancellable</td><td>Optional <a class="el" href="classGio_1_1Cancellable.html" title="Allows actions to be cancelled.">Cancellable</a> object, <code>0</code> to ignore. </td></tr>
593
<dl class="return"><dt><b>Returns:</b></dt><dd>A <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a> on success, <code>0</code> on error. </dd></dl>
597
597
<a class="anchor" id="a8fcc271647a1aa8628d2b2e60dd53d16"></a><!-- doxytag: member="Gio::SocketListener::accept_socket_async" ref="a8fcc271647a1aa8628d2b2e60dd53d16" args="(const Glib::RefPtr< Cancellable > &cancellable, const SlotAsyncReady &slot)" -->
598
598
<div class="memitem">
599
599
<div class="memproto">
680
680
<p>Finishes an async accept operation. </p>
681
681
<p>See g_socket_listener_accept_socket_async()</p>
682
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000160">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
683
<dl><dt><b>Parameters:</b></dt><dd>
684
<table class="params">
685
<tr><td class="paramname">result</td><td>A <a class="el" href="classGio_1_1AsyncResult.html" title="Provides a base class for implementing asynchronous function results.">AsyncResult</a>. </td></tr>
686
<tr><td class="paramname">source_object</td><td>Optional Object identifying this source. </td></tr>
690
<dl class="return"><dt><b>Returns:</b></dt><dd>A <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a> on success, <code>0</code> on error. </dd></dl>
694
<a class="anchor" id="a8875402a2dd1c5b1705236fd89081b3c"></a><!-- doxytag: member="Gio::SocketListener::accept_socket_finish" ref="a8875402a2dd1c5b1705236fd89081b3c" args="(const Glib::RefPtr< AsyncResult > &result, Glib::RefPtr< Glib::Object > &source_object)" -->
695
<div class="memitem">
696
<div class="memproto">
697
<table class="memname">
699
<td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Socket.html">Socket</a>> Gio::SocketListener::accept_socket_finish </td>
701
<td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1AsyncResult.html">AsyncResult</a> >& </td>
702
<td class="paramname"><em>result</em>, </td>
705
<td class="paramkey"></td>
707
<td class="paramtype"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& </td>
708
<td class="paramname"><em>source_object</em> </td>
719
<p>Finishes an async accept operation. </p>
720
<p>See g_socket_listener_accept_socket_async()</p>
682
721
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000159">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
683
722
<dl><dt><b>Parameters:</b></dt><dd>
684
723
<table class="params">
694
<a class="anchor" id="a8875402a2dd1c5b1705236fd89081b3c"></a><!-- doxytag: member="Gio::SocketListener::accept_socket_finish" ref="a8875402a2dd1c5b1705236fd89081b3c" args="(const Glib::RefPtr< AsyncResult > &result, Glib::RefPtr< Glib::Object > &source_object)" -->
695
<div class="memitem">
696
<div class="memproto">
697
<table class="memname">
699
<td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Socket.html">Socket</a>> Gio::SocketListener::accept_socket_finish </td>
701
<td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1AsyncResult.html">AsyncResult</a> >& </td>
702
<td class="paramname"><em>result</em>, </td>
705
<td class="paramkey"></td>
707
<td class="paramtype"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& </td>
708
<td class="paramname"><em>source_object</em> </td>
719
<p>Finishes an async accept operation. </p>
720
<p>See g_socket_listener_accept_socket_async()</p>
721
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000158">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
722
<dl><dt><b>Parameters:</b></dt><dd>
723
<table class="params">
724
<tr><td class="paramname">result</td><td>A <a class="el" href="classGio_1_1AsyncResult.html" title="Provides a base class for implementing asynchronous function results.">AsyncResult</a>. </td></tr>
725
<tr><td class="paramname">source_object</td><td>Optional Object identifying this source. </td></tr>
729
<dl class="return"><dt><b>Returns:</b></dt><dd>A <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a> on success, <code>0</code> on error. </dd></dl>
733
733
<a class="anchor" id="a17961c5dff54d2d6e311c50d2c744bc1"></a><!-- doxytag: member="Gio::SocketListener::add_address" ref="a17961c5dff54d2d6e311c50d2c744bc1" args="(const Glib::RefPtr< SocketAddress > &address, SocketType type, SocketProtocol protocol, Glib::RefPtr< SocketAddress > &effective_address)" -->
734
734
<div class="memitem">
735
735
<div class="memproto">
768
768
<div class="memdoc">
770
770
<p>Creates a socket of type <em>type</em> and protocol <em>protocol</em>, binds it to <em>address</em> and adds it to the set of sockets we're accepting sockets from. </p>
771
<p>Note that adding an IPv6 address, depending on the platform, may or may not result in a listener that also accepts IPv4 connections. For more determinstic behaviour, see g_socket_listener_add_inet_port().</p>
772
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
773
<p>If successful and <em>effective_address</em> is non-<code>0</code> then it will be set to the address that the binding actually occured at. This is helpful for determining the port number that was used for when requesting a binding to port 0 (ie: "any port"). This address, if requested, belongs to the caller and must be freed.</p>
771
<p>Note that adding an IPv6 address, depending on the platform, may or may not result in a listener that also accepts IPv4 connections. For more deterministic behavior, see g_socket_listener_add_inet_port().</p>
772
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
773
<p>If successful and <em>effective_address</em> is non-<code>0</code> then it will be set to the address that the binding actually occurred at. This is helpful for determining the port number that was used for when requesting a binding to port 0 (ie: "any port"). This address, if requested, belongs to the caller and must be freed.</p>
774
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000150">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
775
<dl><dt><b>Parameters:</b></dt><dd>
776
<table class="params">
777
<tr><td class="paramname">address</td><td>A <a class="el" href="classGio_1_1SocketAddress.html" title="Abstract base class representing endpoints for socket communication.">SocketAddress</a>. </td></tr>
778
<tr><td class="paramname">type</td><td>A SocketType. </td></tr>
779
<tr><td class="paramname">protocol</td><td>A SocketProtocol. </td></tr>
780
<tr><td class="paramname">source_object</td><td>Optional Object identifying this source. </td></tr>
781
<tr><td class="paramname">effective_address</td><td>Location to store the address that was bound to, or <code>0</code>. </td></tr>
785
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> on success, <code>false</code> on error. </dd></dl>
789
<a class="anchor" id="a478b171019370dee7059c4a8fdaf6ec2"></a><!-- doxytag: member="Gio::SocketListener::add_address" ref="a478b171019370dee7059c4a8fdaf6ec2" args="(const Glib::RefPtr< SocketAddress > &address, SocketType type, SocketProtocol protocol, const Glib::RefPtr< Glib::Object > &source_object, Glib::RefPtr< SocketAddress > &effective_address)" -->
790
<div class="memitem">
791
<div class="memproto">
792
<table class="memname">
794
<td class="memname">bool Gio::SocketListener::add_address </td>
796
<td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1SocketAddress.html">SocketAddress</a> >& </td>
797
<td class="paramname"><em>address</em>, </td>
800
<td class="paramkey"></td>
802
<td class="paramtype"><a class="el" href="group__giommEnums.html#ga2302a45e052658e343729e0be2fd3310">SocketType</a> </td>
803
<td class="paramname"><em>type</em>, </td>
806
<td class="paramkey"></td>
808
<td class="paramtype"><a class="el" href="group__giommEnums.html#ga4e8932017a600fffa5e8e6b5f6ea5b16">SocketProtocol</a> </td>
809
<td class="paramname"><em>protocol</em>, </td>
812
<td class="paramkey"></td>
814
<td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& </td>
815
<td class="paramname"><em>source_object</em>, </td>
818
<td class="paramkey"></td>
820
<td class="paramtype"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1SocketAddress.html">SocketAddress</a> >& </td>
821
<td class="paramname"><em>effective_address</em> </td>
832
<p>Creates a socket of type <em>type</em> and protocol <em>protocol</em>, binds it to <em>address</em> and adds it to the set of sockets we're accepting sockets from. </p>
833
<p>Note that adding an IPv6 address, depending on the platform, may or may not result in a listener that also accepts IPv4 connections. For more deterministic behavior, see g_socket_listener_add_inet_port().</p>
834
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
835
<p>If successful and <em>effective_address</em> is non-<code>0</code> then it will be set to the address that the binding actually occurred at. This is helpful for determining the port number that was used for when requesting a binding to port 0 (ie: "any port"). This address, if requested, belongs to the caller and must be freed.</p>
774
836
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000149">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
775
837
<dl><dt><b>Parameters:</b></dt><dd>
776
838
<table class="params">
789
<a class="anchor" id="a478b171019370dee7059c4a8fdaf6ec2"></a><!-- doxytag: member="Gio::SocketListener::add_address" ref="a478b171019370dee7059c4a8fdaf6ec2" args="(const Glib::RefPtr< SocketAddress > &address, SocketType type, SocketProtocol protocol, const Glib::RefPtr< Glib::Object > &source_object, Glib::RefPtr< SocketAddress > &effective_address)" -->
790
<div class="memitem">
791
<div class="memproto">
792
<table class="memname">
794
<td class="memname">bool Gio::SocketListener::add_address </td>
796
<td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1SocketAddress.html">SocketAddress</a> >& </td>
797
<td class="paramname"><em>address</em>, </td>
800
<td class="paramkey"></td>
802
<td class="paramtype"><a class="el" href="group__giommEnums.html#ga2302a45e052658e343729e0be2fd3310">SocketType</a> </td>
803
<td class="paramname"><em>type</em>, </td>
806
<td class="paramkey"></td>
808
<td class="paramtype"><a class="el" href="group__giommEnums.html#ga4e8932017a600fffa5e8e6b5f6ea5b16">SocketProtocol</a> </td>
809
<td class="paramname"><em>protocol</em>, </td>
812
<td class="paramkey"></td>
814
<td class="paramtype">const <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGlib_1_1Object.html">Glib::Object</a> >& </td>
815
<td class="paramname"><em>source_object</em>, </td>
818
<td class="paramkey"></td>
820
<td class="paramtype"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a>< <a class="el" href="classGio_1_1SocketAddress.html">SocketAddress</a> >& </td>
821
<td class="paramname"><em>effective_address</em> </td>
832
<p>Creates a socket of type <em>type</em> and protocol <em>protocol</em>, binds it to <em>address</em> and adds it to the set of sockets we're accepting sockets from. </p>
833
<p>Note that adding an IPv6 address, depending on the platform, may or may not result in a listener that also accepts IPv4 connections. For more determinstic behaviour, see g_socket_listener_add_inet_port().</p>
834
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
835
<p>If successful and <em>effective_address</em> is non-<code>0</code> then it will be set to the address that the binding actually occured at. This is helpful for determining the port number that was used for when requesting a binding to port 0 (ie: "any port"). This address, if requested, belongs to the caller and must be freed.</p>
836
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000148">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
837
<dl><dt><b>Parameters:</b></dt><dd>
838
<table class="params">
839
<tr><td class="paramname">address</td><td>A <a class="el" href="classGio_1_1SocketAddress.html" title="Abstract base class representing endpoints for socket communication.">SocketAddress</a>. </td></tr>
840
<tr><td class="paramname">type</td><td>A SocketType. </td></tr>
841
<tr><td class="paramname">protocol</td><td>A SocketProtocol. </td></tr>
842
<tr><td class="paramname">source_object</td><td>Optional Object identifying this source. </td></tr>
843
<tr><td class="paramname">effective_address</td><td>Location to store the address that was bound to, or <code>0</code>. </td></tr>
847
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> on success, <code>false</code> on error. </dd></dl>
851
851
<a class="anchor" id="a8cf1d0491124ef2eb40de9a4392e973b"></a><!-- doxytag: member="Gio::SocketListener::add_any_inet_port" ref="a8cf1d0491124ef2eb40de9a4392e973b" args="()" -->
852
852
<div class="memitem">
853
853
<div class="memproto">
863
863
<div class="memdoc">
865
<p>Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each are available). </p>
865
<p>Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each is available). </p>
866
866
<p>This is useful if you need to have a socket for incoming connections but don't care about the specific port number.</p>
867
867
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
868
<dl class="since_2_24"><dt><b><a class="el" href="since_2_24.html#_since_2_24000035">Since glibmm 2.24:</a></b></dt><dd></dd></dl>
868
<dl class="since_2_24"><dt><b><a class="el" href="since_2_24.html#_since_2_24000037">Since glibmm 2.24:</a></b></dt><dd></dd></dl>
869
869
<dl><dt><b>Parameters:</b></dt><dd>
870
870
<table class="params">
871
871
<tr><td class="paramname">source_object</td><td>Optional Object identifying this source. </td></tr>
892
892
<div class="memdoc">
894
<p>Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each are available). </p>
894
<p>Listens for TCP connections on any available port number for both IPv6 and IPv4 (if each is available). </p>
895
895
<p>This is useful if you need to have a socket for incoming connections but don't care about the specific port number.</p>
896
896
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
897
<dl class="since_2_24"><dt><b><a class="el" href="since_2_24.html#_since_2_24000034">Since glibmm 2.24:</a></b></dt><dd></dd></dl>
897
<dl class="since_2_24"><dt><b><a class="el" href="since_2_24.html#_since_2_24000036">Since glibmm 2.24:</a></b></dt><dd></dd></dl>
898
898
<dl><dt><b>Parameters:</b></dt><dd>
899
899
<table class="params">
900
900
<tr><td class="paramname">source_object</td><td>Optional Object identifying this source. </td></tr>
1001
1001
<p>Adds <em>socket</em> to the set of sockets that we try to accept new clients from. </p>
1002
1002
<p>The socket must be bound to a local address and listened to.</p>
1003
1003
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
1004
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000146">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
1004
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000147">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
1005
1005
<dl><dt><b>Parameters:</b></dt><dd>
1006
1006
<table class="params">
1007
1007
<tr><td class="paramname">socket</td><td>A listening <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>. </td></tr>
1031
1031
<p>Adds <em>socket</em> to the set of sockets that we try to accept new clients from. </p>
1032
1032
<p>The socket must be bound to a local address and listened to.</p>
1033
1033
<p><em>source_object</em> will be passed out in the various calls to accept to identify this particular source, which is useful if you're listening on multiple addresses and do different things depending on what address is connected to.</p>
1034
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000147">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
1034
<dl class="since_2_22"><dt><b><a class="el" href="since_2_22.html#_since_2_22000148">Since glibmm 2.22:</a></b></dt><dd></dd></dl>
1035
1035
<dl><dt><b>Parameters:</b></dt><dd>
1036
1036
<table class="params">
1037
1037
<tr><td class="paramname">socket</td><td>A listening <a class="el" href="classGio_1_1Socket.html" title="Low-level socket object.">Socket</a>. </td></tr>