package caqti

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
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.t

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.t -> stdenv:stdenv -> Sockaddr.t -> (in_channel * out_channel, [> `Msg of string ]) Stdlib.result Fiber.t
val output_char : out_channel -> char -> unit Fiber.t
val output_string : out_channel -> string -> unit Fiber.t
val flush : out_channel -> unit Fiber.t
val input_char : in_channel -> char Fiber.t
val really_input : in_channel -> Stdlib.Bytes.t -> int -> int -> unit Fiber.t
val close_in : in_channel -> unit Fiber.t
OCaml

Innovation. Community. Security.