file: socketservice.aus

class: SocketService

[30:7] extends: object

A GSocketService is an object that represents a service that is provided to the network or over local sockets. When a new connection is made to the service the [signal@Gio.SocketService::incoming] signal is emitted. A GSocketService is a subclass of [class@Gio.SocketListener] and you need to add the addresses you want to accept connections on with the [class@Gio.SocketListener] APIs. There are two options for implementing a network service based on GSocketService. The first is to create the service using [ctor@Gio.SocketService.new] and to connect to the [signal@Gio.SocketService::incoming] signal. The second is to subclass GSocketService and override the default signal handler implementation. In either case, the handler must immediately return, or else it will block additional incoming connections from being serviced. If you are interested in writing connection handlers that contain blocking code then see [class@Gio.ThreadedSocketService]. The socket service runs on the main loop of the thread-default context (see [method@GLib.MainContext.push_thread_default]) 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.

Members

Methods

class: SocketServiceIncomingCallback

[252:7] extends: object

Generated low-level callback wrapper for GIR callback incoming.

Members

Methods

class: SocketServiceMeta

[324:14] static extends: object

Generated metadata helpers for SocketService class surfaces.

Methods