6 releases

✓ Uses Rust 2018 edition

new 0.3.3 Apr 20, 2019
0.3.2 Apr 15, 2019
0.2.0 Apr 12, 2019
0.1.0 Apr 12, 2019

#27 in Operating systems

38 downloads per month
Used in 1 crate

MIT license

73 lines


This crate provides a convenient approach for transmitting multiple messages using one system call (but only on Linux-based operating systems), which will increase performance for large data sets. TCP and UDP protocols are supported.

Pulse · Stargazers · Releases · Contributing


This example sends four messages called data portions to the example.com website using a single system call on an orginary TcpStream:



use sendmmsg::SendMMsg;
use std::io::IoVec;
use std::net::TcpStream;

fn main() {
    // Specify all the messages you want to send
    let messages = &mut [
        (0, IoVec::new(b"Generals gathered in their masses")),
        (0, IoVec::new(b"Just like witches at black masses")),
        (0, IoVec::new(b"Evil minds that plot destruction")),
        (0, IoVec::new(b"Sorcerers of death's construction")),

    // Setup the `TcpStream` instance connected to example.com
    let socket = TcpStream::connect("").unwrap();

    // Finally, send all the messages above
    match socket.sendmmsg(messages) {
        Err(error) => eprintln!("An error occurred: {}!", error),
        Ok(packets) => println!("Packets sent: {}", packets),

More realistic examples are located in the examples directory (and you are able to run them). To investigate the library abstractions, visit the official documentation.


You are always welcome for any contribution to this project! But before you start, you should read the appropriate document to know about the preferred development process and the basic communication rules.


Temirkhan Myrzamadi <gymmasssorla@gmail.com> (the author)