Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GThreadedSocketService

GThreadedSocketService


Description

A threaded GSocketService

Methods and Functions

gThreadedSocketServiceNew(max.threads)
gThreadedSocketService(max.threads)

Hierarchy

GObject
   +----GSocketListener
         +----GSocketService
               +----GThreadedSocketService

Detailed Description

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 ::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 availible to serve incomming requests. The service automatically stops the GSocketService from accepting new connections when all threads are busy.

As with GSocketService, you may connect to "run", or subclass and override the default handler.

Structures

GThreadedSocketService

A helper class for handling accepting incomming connections in the glib mainloop and handling them in a thread. Since 2.22

Convenient Construction

gThreadedSocketService is the equivalent of gThreadedSocketServiceNew.

Signals

run(service, connection, source.object, user.data)

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.

service

the GThreadedSocketService.

connection

a new GSocketConnection object.

source.object

the source_object passed to gSocketListenerAddAddress.

user.data

user data set when the signal handler was connected.

Returns: [logical] TRUE to stope further signal handlers from being called

Properties

max-threads [integer : Read / Write / Construct Only]

The max number of threads handling clients for this service. Allowed values: >= -1 Default value: 10

Author(s)

Derived by RGtkGen from GTK+ documentation

References


RGtk2

R Bindings for Gtk 2.8.0 and Above

v2.20.36
GPL
Authors
Michael Lawrence <michafla@gene.com> and Duncan Temple Lang <duncan@wald.ucdavis.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.