package tiny_httpd

  1. Overview
  2. Docs

Module Tiny_httpd_io.InputSource

Input channel (byte source)

Sourcetype t = {
  1. input : bytes -> int -> int -> int;
    (*

    Read into the slice. Returns 0 only if the channel is closed.

    *)
  2. close : unit -> unit;
    (*

    Close the input. Must be idempotent.

    *)
}

An input channel, i.e an incoming stream of bytes.

This can be a string, an int_channel, an Unix.file_descr, a decompression wrapper around another input channel, etc.

Sourceval of_in_channel : ?close_noerr:bool -> in_channel -> t
Sourceval of_unix_fd : ?close_noerr:bool -> Unix.file_descr -> t
Sourceval input : t -> bytes -> int -> int -> int

Read into the given slice.

  • returns

    the number of bytes read, 0 means end of input.

Sourceval close : t -> unit

Close the channel.

OCaml

Innovation. Community. Security.