Crates.io | async-send-fd |
lib.rs | async-send-fd |
version | 1.2.0 |
source | src |
created_at | 2024-04-08 19:57:02.234791 |
updated_at | 2024-05-22 14:31:43.756298 |
description | A wrapper for async UnixStream's to send file descriptors |
homepage | |
repository | https://github.com/alexander-smoktal/async-send-fd |
max_upload_size | |
id | 1201084 |
size | 24,110 |
A library for sending and receiving Unix file descriptors over async UnixStream connections.
The crate is a library for sending and receiving Unix file descriptors over Tokio or Smol UnixStream connections. You can send RawFd or UnixStream using provided interfaces.
See test_smol_stream.rs or test_tokio_stream.rs for code examples.
If you make a Tokio UnixStream from a raw file descriptor made by an OS call (e.g. UnixStream::pair), you must make it set_nonblocking(true), otherwise receivers scheduler will block writing into the socket ⚠️
Smol UnixStream does it automatically if created using UnixStream::from(Async::new(stream))
Note: the library closes Tokio stream if sent into another process.
tokio
- for Tokio supportsmol
- for Smol support