package cstruct-lwt

  1. Overview
  2. Docs
Access C-like structures directly from OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

cstruct-6.2.0.tbz
sha256=9a78073392580e8349148fa3ab4b1b2e989dc9d30d07401b04c96b7c60f03e62
sha512=8d33fe6b3707a3994d0225cd33cadde0bb2ca834ef01096e3df33a08e4a8c6d02ebccddf558a73988b8a5595b65fdc10de61efbf872c6c9e55c719c7e19c463d

doc/cstruct-lwt/Lwt_cstruct/index.html

Module Lwt_cstructSource

Blocking Lwt functions to read and write from Cstruct buffers.

Sourceval read : Lwt_unix.file_descr -> Cstruct.t -> int Lwt.t

read fd t reads data from the file descriptor fd into the t cstruct.

  • returns

    the numbers of bytes actually read.

Sourceval write : Lwt_unix.file_descr -> Cstruct.t -> int Lwt.t

write fd t writes data from the t cstruct to the file descriptor fd.

  • returns

    the numbers of bytes actually written.

Sourceval complete : (Cstruct.t -> int Lwt.t) -> Cstruct.t -> unit Lwt.t

complete (read fd) t fills t with data from fd.

complete (write fd) t fully-writes t to fd.

  • raises End_of_file

    if the file descriptor operation fails.

Sourceval sendto : Lwt_unix.file_descr -> Cstruct.t -> Unix.msg_flag list -> Unix.sockaddr -> int Lwt.t

sendto fd t flags sa invokes Lwt_unix.sendto on the t cstruct.

  • returns

    the number of bytes sent.

Sourceval recvfrom : Lwt_unix.file_descr -> Cstruct.t -> Unix.msg_flag list -> (int * Unix.sockaddr) Lwt.t

recvfrom fd t flags sa invokes Lwt_unix.recvfrom on the t cstruct.

  • returns

    the number of bytes read and the socket address of the remote side.

OCaml

Innovation. Community. Security.