docs.rs failed to build vma-socket-0.1.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
vma-socket
A flexible high-level Rust API for TCP/UDP sockets leveraging Mellanox/NVIDIA VMA (Messaging Accelerator) for low-latency networking.
Overview
vma-socket
provides a clean, ergonomic Rust interface to the VMA library, allowing developers to access the performance benefits of VMA while working with a familiar and safe API. The library offers:
- Simple, idiomatic Rust wrappers for UDP and TCP sockets
- Configurable options for different performance requirements
- Flexible timeout and polling mechanisms
- Safe memory handling and error management
Requirements
- Mellanox RDMA-capable network adapter
- Mellanox OFED drivers
- VMA library (
libvma.so
) - Linux environment
Installation
Add this to your Cargo.toml
:
[]
= "0.1"
Basic Usage
UDP Example
use Duration;
use VmaUdpSocket;
use VmaOptions;
// Create a UDP socket
let mut socket = new?;
// Or with custom options
let options = low_latency;
let mut socket = with_options?;
// Server: bind to an address
socket.bind?;
// Client: connect to a server
socket.connect?;
socket.send?;
// Receive data with timeout
let mut buffer = vec!;
match socket.recv_from?
TCP Example
use Duration;
use VmaTcpSocket;
use VmaOptions;
// Server example
let mut server = new?;
server.bind?;
server.listen?;
if let Some = server.accept?
// Client example
let mut client = new?;
if client.connect?
Configuration Options
The library allows flexible configuration:
// Use predefined profiles
let low_latency = low_latency;
let high_throughput = high_throughput;
// Or customize your own
let custom_options = VmaOptions ;
Running with VMA
To use the VMA acceleration, preload the VMA library when running your application:
LD_PRELOAD=/usr/lib64/libvma.so.x.x.x
Development Helper Script
For testing examples, use the included run.sh script:
# Terminal 1: Run UDP server
# Terminal 2: Run UDP client
You can also specify addresses and ports:
License
This project is licensed under the MIT or Apache-2.0 License.