package caqti

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a fiber
type switch
type stdenv
module Sockaddr : sig ... end
type in_channel
type out_channel
val getaddrinfo : stdenv:stdenv -> [ `host ] Domain_name.t -> int -> (Sockaddr.t list, [> `Msg of string ]) Stdlib.result fiber

This should be a specialized version of getaddrinfo, which only returns entries which is expected to work with the corresponding connect on the platform implementing this interface. In particular:

  • The family can be IPv4 or IPv6, where supported, and this must be encoded in the Sockaddr.t.
  • The socket type is restricted to STREAM.
  • The protocol is assumed to be selected automatically from address family, given the socket type restriction.

All returned values are TCP destinations. If a distinction can be made, an empty list indicates that the address has no DNS entries, while an error return indicates that an appropriate DNS server could not be queried.

val connect : sw:switch -> stdenv:stdenv -> Sockaddr.t -> (in_channel * out_channel, [> `Msg of string ]) Stdlib.result fiber
val output_char : out_channel -> char -> unit fiber
val output_string : out_channel -> string -> unit fiber
val flush : out_channel -> unit fiber
val input_char : in_channel -> char fiber
val really_input : in_channel -> Stdlib.Bytes.t -> int -> int -> unit fiber
val close_in : in_channel -> unit fiber
OCaml

Innovation. Community. Security.