Sets our main struct and passes it to the parent class.
Creates a new gio.ThreadedSocketService with no listeners. Listeners must be added with one of the gio.SocketListener "add" methods.
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.
the main Gtk struct as a void*
Get the main Gtk struct
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Check whether the service is active or not. An active service will accept new clients that connect, while a non-active service will let connecting clients queue up until the service is started.
Restarts the service, i.e. start accepting connections from the added sockets when the mainloop runs. This only needs to be called after the service has been stopped from Socket.serviceStop.
Stops the service, i.e. stops accepting connections from the added sockets when the mainloop runs.
The ::incoming signal is emitted when a new incoming connection to service needs to be handled. The handler must initiate the handling of connection, but may not block; in essence, asynchronous operations must be used.
A gio.ThreadedSocketService is a simple subclass of gio.SocketService that handles incoming connections by creating a worker thread and dispatching the connection to it by emitting the run signal in the new thread.
The signal handler may perform blocking IO 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.SocketService from accepting new connections when all threads are busy.
As with gio.SocketService, you may connect to run, or subclass and override the default handler.