This commit is contained in:
Simon Cruanes 2025-04-30 21:46:03 -04:00
parent 295b3b5c24
commit 8de6936787
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -4,29 +4,33 @@ val setup_bg_thread : Nanoev.t -> unit
(** Install this event loop in a background thread *) (** Install this event loop in a background thread *)
val has_bg_thread : unit -> bool val has_bg_thread : unit -> bool
(** [has_bg_thread ()] is [true] iff a background thread is running a nanoev loop *) (** [has_bg_thread ()] is [true] iff a background thread is running a nanoev
loop *)
(** {2 Non blocking IO primitives} *) (** {2 Non blocking IO primitives} *)
val read : Unix.file_descr -> bytes -> int -> int -> int val read : Unix.file_descr -> bytes -> int -> int -> int
(** Read from the non blocking FD. (** Read from the non blocking FD.
@raise Nanoev.Closed if the FD is closed @raise Nanoev.Closed if the FD is closed
@raise Unix.Unix_error for other errors *) @raise Unix.Unix_error for other errors *)
val write : Unix.file_descr -> bytes -> int -> int -> int val write : Unix.file_descr -> bytes -> int -> int -> int
(** Write into the non blocking FD. (** Write into the non blocking FD.
@raise Nanoev.Closed if the FD is closed @raise Nanoev.Closed if the FD is closed
@raise Unix.Unix_error for other errors *) @raise Unix.Unix_error for other errors *)
val close : Unix.file_descr -> unit val close : Unix.file_descr -> unit
(** Close the file descriptor (** Close the file descriptor
@raise Unix.Unix_error when it fails *) @raise Unix.Unix_error when it fails *)
val connect : Unix.file_descr -> Unix.sockaddr -> unit val connect : Unix.file_descr -> Unix.sockaddr -> unit
(** Connect this FD to the remote address.
@raise Nanoev.Closed if the FD is closed.
@raise Unix.Unix_error for other errors *)
val accept : Unix.file_descr -> Unix.file_descr * Unix.sockaddr val accept : Unix.file_descr -> Unix.file_descr * Unix.sockaddr
(** Accept a connection on this fd. (** Accept a connection on this fd.
@raise Nanoev.Closed if the FD is closed. @raise Nanoev.Closed if the FD is closed.
@raise Unix.Unix_error for other errors *) @raise Unix.Unix_error for other errors *)
val sleep : float -> unit val sleep : float -> unit