X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgsocketservice.c;h=81053f0ab6030832ce53f692a93553b2e1f56440;hb=7103484017ff000d01ed94567539d37fa09b32b2;hp=b8ae9eb67319be0cd8ade1fda7d390c454face62;hpb=32747def4bb4cce7cfc4f0f8ba8560392ec9ad3d;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gsocketservice.c b/gio/gsocketservice.c index b8ae9eb..81053f0 100644 --- a/gio/gsocketservice.c +++ b/gio/gsocketservice.c @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. + * Public License along with this library; if not, see . * * Authors: Ryan Lortie * Alexander Larsson @@ -26,6 +24,7 @@ * SECTION:gsocketservice * @title: GSocketService * @short_description: Make it easy to implement a network service + * @include: gio/gio.h * @see_also: #GThreadedSocketService, #GSocketListener. * * A #GSocketService is an object that represents a service that @@ -48,9 +47,9 @@ * If you are interested in writing connection handlers that contain * blocking code then see #GThreadedSocketService. * - * The socket service runs on the main loop of the thread-default - * context of the thread it is created in, and is not + * The socket service runs on the main loop of the + * [thread-default context][g-main-context-push-thread-default-context] + * of the thread it is created in, and is not * threadsafe in general. However, the calls to start and stop the * service are thread-safe so these can be used from threads that * handle incoming clients. @@ -93,7 +92,7 @@ g_socket_service_real_incoming (GSocketService *service, static void g_socket_service_init (GSocketService *service) { - service->priv = g_socket_service_get_private (service); + service->priv = g_socket_service_get_instance_private (service); service->priv->cancellable = g_cancellable_new (); service->priv->active = TRUE; } @@ -130,11 +129,7 @@ g_socket_service_changed (GSocketListener *listener) if (service->priv->outstanding_accept) g_cancellable_cancel (service->priv->cancellable); else - { - g_socket_listener_accept_async (listener, service->priv->cancellable, - g_socket_service_ready, NULL); - service->priv->outstanding_accept = TRUE; - } + do_accept (service); } G_UNLOCK (active); @@ -204,6 +199,12 @@ g_socket_service_start (GSocketService *service) * This call is thread-safe, so it may be called from a thread * handling an incoming client request. * + * Note that this only stops accepting new connections; it does not + * close the listening sockets, and you can call + * g_socket_service_start() again later to begin listening again. To + * close the listening sockets, call g_socket_listener_close(). (This + * will happen automatically when the #GSocketService is finalized.) + * * Since: 2.22 */ void