8 breaking releases

0.9.0 Jul 6, 2021
0.8.0 Jan 5, 2021
0.7.0 Jan 4, 2020
0.5.0 Dec 17, 2019
0.1.0 Sep 26, 2018

#1946 in Network programming

Download history 20768/week @ 2024-07-23 17062/week @ 2024-07-30 19204/week @ 2024-08-06 18916/week @ 2024-08-13 18154/week @ 2024-08-20 18949/week @ 2024-08-27 18512/week @ 2024-09-03 13300/week @ 2024-09-10 12272/week @ 2024-09-17 16549/week @ 2024-09-24 15381/week @ 2024-10-01 11722/week @ 2024-10-08 18022/week @ 2024-10-15 18580/week @ 2024-10-22 16857/week @ 2024-10-29 16365/week @ 2024-11-05

72,189 downloads per month
Used in 34 crates (8 directly)

MIT/Apache

28KB
633 lines

parity-tokio-ipc

CI Documentation

This crate abstracts interprocess transport for UNIX/Windows.

It utilizes unix sockets on UNIX (via tokio::net::UnixStream) and named pipes on windows (via tokio::net::windows::named_pipe module).

Endpoint is transport-agnostic interface for incoming connections:

use parity_tokio_ipc::Endpoint;
use futures::stream::StreamExt;

// For testing purposes only - instead, use a path to an actual socket or a pipe
let addr = parity_tokio_ipc::dummy_endpoint();

let server = async move {
    Endpoint::new(addr)
        .incoming()
        .expect("Couldn't set up server")
        .for_each(|conn| async {
            match conn {
                Ok(stream) => println!("Got connection!"),
                Err(e) => eprintln!("Error when receiving connection: {:?}", e),
            }
        });
};

let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
rt.block_on(server);

License

parity-tokio-ipc is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, and LICENSE-MIT for details.

Dependencies

~4–13MB
~144K SLoC