Skip to content

Commit 3917e58

Browse files
committed
Unix Sender wip
1 parent d07ecd3 commit 3917e58

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

wgpu-remote/src/transport/unix.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
//! Transports based on Unix facilities.
2+
3+
/// A [`Sender`] implementation based on mmap and Unix domain sockets.
4+
///
5+
/// This type implements [`transport::Sender`] based on a Unix domain socket
6+
/// connection to the counterpart that you supply. It uses the [`memfd_create`]
7+
/// system call to create shared memory segments, and then uses [AF_UNIX]'s
8+
/// `SCM_RIGHTS` ancillary message to pass those file descriptors across the
9+
/// socket to the counterpart.
10+
///
11+
/// [`transport::Sender`]: crate::transport::Sender
12+
/// [`memfd_create`]: https://man7.org/linux/man-pages/man2/memfd_create.2.html
13+
/// [AF_UNIX]: https://man7.org/linux/man-pages/man7/unix.7.html
14+
struct Sender {
15+
/// The connection to the counterpart.
16+
socket: std::os::fd::OwnedFd,
17+
18+
/// The id of the next shared memory segment we'll allocate.
19+
next_shmem_id: std::sync::AtomicUsize,
20+
}
21+

0 commit comments

Comments
 (0)