package httpcats

  1. Overview
  2. Docs

Parameter Make.Flow

type t
val read : t -> Bstr.t -> off:int -> len:int -> int

read flow bstr ~off ~len reads at most len bytes from flow into bstr at off and returns how many bytes were actually read. 0 means end-of-input.

val writev : t -> Bstr.t Faraday.iovec list -> unit

writev flow iovecs writes all the given iovecs to flow.

NOTE: the buffers of iovecs belong to the caller and are reused as soon as writev returns. An implementation which defers the actual transmission (such as utcp, which keeps the segment in its own state) must take a copy.

  • raises Closed_by_peer

    if the peer closed the connection on its side.

val close : t -> unit
val shutdown : t -> [ `read | `write | `read_write ] -> unit