gio.threaded_socket_service

Module for [ThreadedSocketService] class

Types 3

A [gio.threaded_socket_service.ThreadedSocketService] is a simple subclass of [gio.socket_service.SocketService] that handles incoming connections by creating a worker thread and dispatching the connection to it by emitting the [gio.threaded_socket_service.ThreadedSocketService.run] in the new thread.

The signal handler may perform blocking I/O and need not return until the connection is closed.

The service is implemented using a thread pool, so there is a limited amount of threads available to serve incoming requests. The service automatically stops the [gio.socket_service.SocketService] from accepting new connections when all threads are busy.

As with [gio.socket_service.SocketService], you may connect to [gio.threaded_socket_service.ThreadedSocketService.run], or subclass and override the default handler.

Methods
GType _gType() @property
ThreadedSocketService self()Returns `this`, for use in `with` statements.
ThreadedSocketServiceGidBuilder builder()Get builder for [gio.threadedsocketservice.ThreadedSocketService] Returns: New builder object
int maxThreads() @propertyGet `maxThreads` property. Returns: The maximum number of threads handling clients for this service.
gulong connectRun(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gio.socket_connection.SocketConnection))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gobject.object.ObjectWrap))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gio.threaded_socket_service.ThreadedSocketService))) && Parameters!T.length < 4)Connect to `Run` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(int maxThreads)Creates a new #GThreadedSocketService with no listeners. Listeners must be added with one of the #GSocketListener "add" methods.
Methods
T maxThreads(int propval)Set `maxThreads` property. Params: propval = The maximum number of threads handling clients for this service. Returns: Builder instance for fluent chaining

Fluent builder for [gio.threaded_socket_service.ThreadedSocketService]