package hvsock

  1. Overview
  2. Docs

A buffered Mirage FLOW implementation over a hypervisor socket

Parameters

module Time : Mirage_time.S
module Fn : S.FN

Signature

type error = [
  1. | `Unix of Unix.error
]
include Mirage_flow_combinators.SHUTDOWNABLE with type error := error
include Mirage_flow.S with type error := error
val pp_error : error Fmt.t
type nonrec write_error = private [>
  1. | Mirage_flow.write_error
]
val pp_write_error : write_error Fmt.t
type flow
val read : flow -> (Cstruct.t Mirage_flow.or_eof, error) Stdlib.result Lwt.t
val write : flow -> Cstruct.t -> (unit, write_error) Stdlib.result Lwt.t
val writev : flow -> Cstruct.t list -> (unit, write_error) Stdlib.result Lwt.t
val close : flow -> unit Lwt.t
val shutdown_write : flow -> unit Lwt.t

Close the write direction of the flow, flushing any buffered data and causing future calls to read by the peer to return `Eof.

val shutdown_read : flow -> unit Lwt.t

Close the read direction of the flow, such that future calls to write by the peer will return `Eof

val connect : ?message_size:int -> ?buffer_size:int -> Socket.t -> flow

Construct a flow given a hypervisor socket connection. ?message_size allows the maximum send/recv size to be limited. ?buffer_size controls how much buffering is placed over the socket.

Note the buffer handling of this flow is different to normal: `read` and `readv` will retain references to the passed buffers. They must not be used again by the calling application.

val read_into : flow -> Cstruct.t -> (unit Mirage_flow.or_eof, error) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.