Up

Module Bio

Signature

type t
val sexp_of_t : t -> Sexplib.Sexp.t
val create : unit -> t

Create a new 'infinite' memory-backed IO queue, to replace a socket that openssl traditionally needs.

val read : t -> buf:char Ctypes_packed.Ctypes.ptr -> len:int -> int

Read some bytes from a BIO.

Returns either the amount of data successfully read (if the return value is positive) or that no data was successfully read if the result is 0 or -1. If the return value is -2 then the operation is not implemented in the specific BIO type.

val write : t -> buf:string -> len:int -> int

Write some bytes to a BIO.

Returns either the amount of data successfully written (if the return value is positive) or that no data was successfully written if the result is 0 or -1. If the return value is -2 then the operation is not implemented in the specific BIO type.