docs: Move the GSocketService SECTION

Move it to the struct docs.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
This commit is contained in:
Philip Withnall 2023-11-02 16:24:14 +00:00
parent bf5c0cc2ba
commit 45a815ae6d

View File

@ -23,37 +23,33 @@
*/ */
/** /**
* SECTION:gsocketservice * 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 * A `GSocketService` is an object that represents a service that
* is provided to the network or over local sockets. When a new * is provided to the network or over local sockets. When a new
* connection is made to the service the #GSocketService::incoming * connection is made to the service the [signal@Gio.SocketService::incoming]
* signal is emitted. * signal is emitted.
* *
* A #GSocketService is a subclass of #GSocketListener and you need * A `GSocketService` is a subclass of [class@Gio.SocketListener] and you need
* to add the addresses you want to accept connections on with the * to add the addresses you want to accept connections on with the
* #GSocketListener APIs. * [class@Gio.SocketListener] APIs.
* *
* There are two options for implementing a network service based on * There are two options for implementing a network service based on
* #GSocketService. The first is to create the service using * `GSocketService`. The first is to create the service using
* g_socket_service_new() and to connect to the #GSocketService::incoming * [ctor@Gio.SocketService.new] and to connect to the
* signal. The second is to subclass #GSocketService and override the * [signal@Gio.SocketService::incoming] signal. The second is to subclass
* default signal handler implementation. * `GSocketService` and override the default signal handler implementation.
* *
* In either case, the handler must immediately return, or else it * In either case, the handler must immediately return, or else it
* will block additional incoming connections from being serviced. * will block additional incoming connections from being serviced.
* If you are interested in writing connection handlers that contain * If you are interested in writing connection handlers that contain
* blocking code then see #GThreadedSocketService. * blocking code then see [class@Gio.ThreadedSocketService].
* *
* The socket service runs on the main loop of the * The socket service runs on the main loop of the
* [thread-default context][g-main-context-push-thread-default-context] * thread-default context (see
* of the thread it is created in, and is not * [method@GLib.MainContext.push_thread_default_context]) of the thread it is
* threadsafe in general. However, the calls to start and stop the * created in, and is not threadsafe in general. However, the calls to start and
* service are thread-safe so these can be used from threads that * stop the service are thread-safe so these can be used from threads that
* handle incoming clients. * handle incoming clients.
* *
* Since: 2.22 * Since: 2.22