pub fn new<P: AsRef<Path>>(path: P, unlink: bool) -> Result<Self> {
        if unlink {
            let _ = std::fs::remove_file(&path);
        }
        let fd = UnixListener::bind(&path).map_err(Error::SocketError)?;

        Ok(Listener {
            fd,
            path: Some(path.as_ref().to_owned()),
        })
    }
/// Create a unix domain socket listener.
///
/// # Return:
/// * - the new Listener object on success.
/// * - SocketError: failed to create listener socket.
Create a unix domain socket listener.
Create a unix domain socket listener .
pub fn new<P: AsRef<Path>>(path: P, unlink: bool) -> Result<Self> {
        if unlink {
            let _ = std::fs::remove_file(&path);
        }
        let fd = UnixListener::bind(&path).map_err(Error::SocketError)?;
        Ok(Listener {
            fd,
            path: Some(path.as_ref().to_owned()),
        })
    }
pub fn new < P : AsRef < Path > > ( path : P , unlink : bool ) -> Result < Self > { if unlink { let _ = std :: fs :: remove_file ( & path ) ; } let fd = UnixListener :: bind ( & path ) . map_err ( Error :: SocketError ) ? ; Ok ( Listener { fd , path : Some ( path . as_ref ( ) . to_owned ( ) ) , } ) }
Create a unix domain socket listener.
Create a unix domain socket listener .
path
P
unlink
bool
path
P
unlink
bool
return:
- the new Listener object on success.
- SocketError: failed to create listener socket.
- the new Listener object on success . - SocketError : failed to create listener socket .