Can't get a secondary handle to a TcpStream #202
Replies: 1 comment
-
Hmm, this might be a limitation of However, the Without upstream support, we'd probably be better off changing Rust In the meantime, as a workaround, you can try using the let fd = stream.as_raw_fd();
let new_stream = unsafe {
let new_fd = libc::dup(fd);
if new_fd < 0 {
// handle error
}
TcpStream::from_raw_fd(new_fd)
}; |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Using
TcpStream::try_clone()
always netsErr(Os { code: 22, kind: InvalidInput, message: "Invalid argument" })
. Am I doing something wrong, or is this a bug?Beta Was this translation helpful? Give feedback.
All reactions