It derives from <GSocketService>.
A <GThreadedSocketService> is a
simple subclass of <GSocketService> that
handles incoming connections by creating a worker thread and dispatching
the connection to it by emitting the
[signal@Gio.ThreadedSocketService::run signal] 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 <GSocketService>
from accepting new connections when all threads are busy.
As with <GSocketService>, you may connect to
threaded-socket-service:run, or subclass and override the default
handler.
parent-instanceprivThe maximum number of threads handling clients for this service.
Its value is a 32-bit integer.
It can only be set when the object is made, with #:max-threads.
Creates a new
<GThreadedSocketService> with no
listeners. Listeners must be added with one of the
<GSocketListener> "add" methods.
Passed: a 32-bit integer.
the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
Returned: a <GSocketService>.
a new <GSocketService>.
Connect a handler with (connect object threaded-socket-service:run
handler). It is called as (handler self connection
source-object) ⇒ %return.
The ::run signal is emitted in a worker thread in response to an incoming connection. This thread is dedicated to handling connection and may perform blocking IO. The signal handler need not return until the connection is closed.
Passed: a <GThreadedSocketService>.
Passed: a <GSocketConnection>.
a new <GSocketConnection> object.
Passed: a <GObject>, or #f.
the source_object passed to socket-listener:add-address.
Returned: a boolean.
#t to stop further signal handlers from being called
To override it in a new class, give register-type #:vfuncs
`((run . ,procedure)). The procedure is called as (procedure
self connection source-object) ⇒ %return.
Passed: the class whose implementation to call:
<GThreadedSocketService>, or a class
that derives from it, or its GType number.
Passed: a <GThreadedSocketService>.
Passed: a <GSocketConnection>.
Passed: a <GObject>.
Returned: a boolean.