gSocketServiceNew()
gSocketServiceStart(object)
gSocketServiceStop(object)
gSocketServiceIsActive(object)
gSocketService()
GObject +----GSocketListener +----GSocketService +----GThreadedSocketService
GSocketService
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 GSocketService
is a subclass of GSocketListener
and you need
to add the addresses you want to accept connections on to the
with the GSocketListener
APIs. There are two options for implementing a network service based on
GSocketService
. The first is to create the service using
gSocketServiceNew
and to connect to the "incoming"
signal. The second is to subclass GSocketService
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 GThreadedSocketService
. The socket service runs on the main loop in the main thread, and is
not threadsafe in general. However, the calls to start and stop
the service are threadsafe so these can be used from threads that
handle incoming clients.gSocketService
is the equivalent of gSocketServiceNew
.