package nbd

  1. Overview
  2. Docs

Channels represent connections between clients and servers.

An open channel to an NBD client or server.

type tls_channel = {
  1. read_tls : Cstruct.t -> unit Lwt.t;
  2. write_tls : Cstruct.t -> unit Lwt.t;
  3. close_tls : unit -> unit Lwt.t;
}
type cleartext_channel = {
  1. read_clear : Cstruct.t -> unit Lwt.t;
  2. write_clear : Cstruct.t -> unit Lwt.t;
  3. close_clear : unit -> unit Lwt.t;
  4. make_tls_channel : (unit -> tls_channel Lwt.t) option;
}
type generic_channel = {
  1. is_tls : bool;
  2. read : Cstruct.t -> unit Lwt.t;
  3. write : Cstruct.t -> unit Lwt.t;
  4. close : unit -> unit Lwt.t;
}
type channel = generic_channel
val generic_of_tls_channel : tls_channel -> generic_channel
val generic_of_cleartext_channel : cleartext_channel -> generic_channel
OCaml

Innovation. Community. Security.