Skip to main content

Crate tiny_vsock

Crate tiny_vsock 

Source
Expand description

Tiny vsock is a Rust library that provides an abstraction over vsock (AF_VSOCK) sockets for communication between hosts and virtual machines or enclaves. It offers a simple API for creating, connecting, binding, listening, accepting, sending, and receiving data through vsock sockets. The library is designed to be efficient and easy to use, with built-in retry mechanisms for connection attempts and chunked data transfer for optimal performance.

§Features

  • std-io: Enables implementation of the standard Read and Write traits for Vsock, allowing it to be used with standard Rust I/O patterns.

§Examples

  • enclave-echo-service — binds, accepts one connection, receives data, and echoes it back; run inside the enclave
  • parent-echo-client — connects to the enclave service, sends a message, and reads the echo; run on the parent instance
  • std_io_echo — demonstrates std::io::Read / std::io::Write via BufReader and flush; requires --features std-io

Structs§

Vsock
Abstraction over a vsock (AF_VSOCK) socket for communication between hosts and virtual machines or enclaves.