TODO: Move internal socket ownership and closing logic into a seperate internal struct to handle Drop impl more safely.

Fortune for comfork's current commit: Blessing − 吉
master
Avril 3 years ago
parent fc4bf7e09e
commit a2f208bc6b
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -19,6 +19,7 @@ pub enum ErrorKind
} }
/// A raw unix pipe /// A raw unix pipe
// TODO: Change uses of `i32` for socket fds. Or change this to a struct (see below.)
pub type RawPipe = i32; pub type RawPipe = i32;
/// Create a raw pipe pair. /// Create a raw pipe pair.
@ -33,6 +34,9 @@ pub(crate) fn unix_pipe() -> Result<(i32, i32), Error>
} }
} }
//TODO: Factor out the `i32` raw sockets in these types below into a seperate `RawPipe` struct, which has the Drop impl and has functions for transfering ownership of the raw socket (it should hide the raw fd when not explicitly needed ideally.)
// This will prevent us from having to ensure we `forget()` the outer type each time we want to move the inner one around without closing it.
/// A writer for a bi-directinoal unix pipe /// A writer for a bi-directinoal unix pipe
/// ///
/// Created by splitting `Pipe`, data written to this is available to be read from its `ReadHalf` counterpart. /// Created by splitting `Pipe`, data written to this is available to be read from its `ReadHalf` counterpart.

Loading…
Cancel
Save