module Lwt_lib:Cooperative unix system callssig
..end
Indeed, lots of functions of the Unix
modules, corresponding to
functions of the standard C library may take times to
complete. For example gethostbyname
may use DNS resolution,
users informations may be stored in a ldap database, ...
Since these functions are implemented (in the standard C library)
using blocking IOs, if you use them directly, you program may
hang.
val getaddrinfo : string -> string -> Unix.getaddrinfo_option list -> Unix.addr_info list Lwt.t
val gethostbyname : string -> Unix.host_entry Lwt.t
val getnameinfo : Unix.sockaddr -> Unix.getnameinfo_option list -> Unix.name_info Lwt.t