Crates.io | tokio-send-fd |
lib.rs | tokio-send-fd |
version | 0.9.4 |
source | src |
created_at | 2022-06-26 13:20:18.643829 |
updated_at | 2024-04-08 17:04:23.262826 |
description | A wrapper for tokio::net::UnixStream to send file descriptors |
homepage | |
repository | https://github.com/alexander-smoktal/tokio-send-fd |
max_upload_size | |
id | 613541 |
size | 12,892 |
⚠️This crate is deprecated. Use async-send-fd instead.
A library to send tokio UnixStream and raw file descriptors over tokio UnixStream connections.
The crate is a library for sending and receiving Unix file descriptors over tokio UnixStream connections. You can transfer RawFd or UnixStream. See test_raw_fd.rs and test_tokio_stream.rs for examples.
If you want to create tokio UnixStream from a raw file descriptor created by os' UnixStream::pair call, you should make it set_nonblocking(true), otherwise tokio stream will block event in async functions ⚠️
Sending a socket of a socket pair doesn't close the local copy, which leads to having the socket being opened until the sender is shut down. If you want counterparties to detect peer shutdown, you have to close socket pair right after sending a socket to a peer. Use close Posix call.