W Wrapl, The Programming Language

Libraries:Gtk:Gio:GSocketService

Types

T

Inherits from:

A T 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 T is a subclass of Gtk.Gio.GSocketListener.T and you need to add the addresses you want to accept connections on with the Gtk.Gio.GSocketListener.T APIs.

There are two options for implementing a network service based on T. The first is to create the service using g_socket_service_new() and to connect to the "incoming" signal. The second is to subclass T 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 Gtk.Gio.GThreadedSocketService.T.

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.



Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



New() : Gtk.Gio.GSocketService.T

Creates a new T with no sockets to listen for. New listeners can be added with e.g. Gtk.Gio.GSocketListener.AddAddress or Gtk.Gio.GSocketListener.AddInetPort.

Returns a new T.


Methods

:IsActive(self @ T) : Std.Symbol.T

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.

service a T
Returns TRUE if the service is active, FALSE otherwise


:Priv(self @ T) : Std.Object.T

:Start(self @ T) : Std.Object.T

Starts the service, i.e. start accepting connections from the added sockets when the mainloop runs.

This call is threadsafe, so it may be called from a thread handling an incoming client request.

service a T


:Stop(self @ T) : Std.Object.T

Stops the service, i.e. stops accepting connections from the added sockets when the mainloop runs.

This call is threadsafe, so it may be called from a thread handling an incoming client request.

service a T


:setPriv(self @ T, value @ Std.Object.T) : Std.Object.T