gi-gio-2.0.14: Gio bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Objects.ThreadedSocketService

Contents

Description

A ThreadedSocketService is a simple subclass of SocketService that handles incoming connections by creating a worker thread and dispatching the connection to it by emitting the ThreadedSocketService::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 SocketService from accepting new connections when all threads are busy.

As with SocketService, you may connect to ThreadedSocketService::run, or subclass and override the default handler.

Synopsis

Exported types

Methods

new

threadedSocketServiceNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

maxThreads: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit

-> m ThreadedSocketService

Returns: a new SocketService.

Creates a new ThreadedSocketService with no listeners. Listeners must be added with one of the SocketListener "add" methods.

Since: 2.22

Properties

maxThreads

Signals

run