package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gio/Ocgtk_gio/Gio/Wrappers/Socket_service/index.html

Module Wrappers.Socket_service

type t = [ `socket_service | `socket_listener | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new SocketService

val stop : t -> unit

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

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

Note that this only stops accepting new connections; it does not close the listening sockets, and you can call g_socket_service_start() again later to begin listening again. To close the listening sockets, call g_socket_listener_close(). (This will happen automatically when the #GSocketService is finalized.)

This must be called before calling g_socket_listener_close() as the socket service will start accepting connections immediately when a new socket is added.

val start : t -> unit

Restarts the service, i.e. start accepting connections from the added sockets when the mainloop runs. This only needs to be called after the service has been stopped from g_socket_service_stop().

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

val is_active : t -> bool

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.

val get_active : t -> bool

Get property: active

val set_active : t -> bool -> unit

Set property: active