The UnixStream has an FD leakage problem.
silence-coding opened this issue · comments
The UnixStream has an FD leakage problem.
When the socket_addr error occurs, the socket is not released.
let socket = new_socket(libc::AF_UNIX, libc::SOCK_STREAM)?;
let (sockaddr, socklen) = socket_addr(path)?;
let sockaddr = &sockaddr as *const libc::sockaddr_un as *const libc::sockaddr;
-
mio/src/sys/unix/uds/stream.rs
Line 11 in 0accf7d
-
mio/src/sys/unix/uds/listener.rs
Line 11 in 0accf7d
-
Line 39 in 0accf7d
Yup, good find.
I imagine most UDS implementations are the same. I'll take a look at them
I took a look and found two places. Why not follow the standard library? When the socket is created, it returns a wrapper object, which is released in the drop method of the object.
I imagine most UDS implementations are the same. I'll take a look at them
Thank you for your reply