SocketService


Object Hierarchy:

Object hierarchy for SocketService

Description:

public class SocketService : SocketListener

A SocketService is an object that represents a service that is provided to the network or over local sockets.

When a new connection is made to the service the incoming signal is emitted.

A SocketService is a subclass of SocketListener and you need to add the addresses you want to accept connections on with the SocketListener APIs.

There are two options for implementing a network service based on SocketService. The first is to create the service using SocketService and to connect to the incoming signal. The second is to subclass SocketService and override the default signal handler implementation.

In either case, the handler must immediately return, or else it will block additional incoming connections from being serviced. If you are interested in writing connection handlers that contain blocking code then see ThreadedSocketService.

The socket service runs on the main loop of the thread-default context of the thread it is created in, and is not threadsafe in general. However, the calls to start and stop the service are thread-safe so these can be used from threads that handle incoming clients.

All known sub-classes:
 

Namespace: GLib
Package: gio-2.0

Content:

Creation methods:

Methods:

Signals:

Inherited Members: