pub async fn connect<A: AsRef<Path>>(addr: A) -> Result<UnixStream> {
        let reactor = crate::executor().reactor();

        let socket = Socket::new(Domain::unix(), Type::stream(), None)?;
        let addr = SockAddr::new_unix(addr.as_ref())
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
        let source = reactor.connect(socket.as_raw_fd(), addr);
        source.collect_rw().await?;

        Ok(Self {
            stream: GlommioStream::from(socket),
        })
    }
/// Creates a Unix connection to the specified endpoint.
///
/// # Examples
///
/// ```no_run
/// use glommio::{net::UnixStream, LocalExecutor};
///
/// let ex = LocalExecutor::default();
/// ex.run(async move {
///     UnixStream::connect("/tmp/named").await.unwrap();
/// })
/// ```
Creates a Unix connection to the specified endpoint.
Creates a Unix connection to the specified endpoint .
pub async fn connect<A: AsRef<Path>>(addr: A) -> Result<UnixStream> {
        let reactor = crate::executor().reactor();
        let socket = Socket::new(Domain::unix(), Type::stream(), None)?;
        let addr = SockAddr::new_unix(addr.as_ref())
            .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
        let source = reactor.connect(socket.as_raw_fd(), addr);
        source.collect_rw().await?;
        Ok(Self {
            stream: GlommioStream::from(socket),
        })
    }
pub async fn connect < A : AsRef < Path > > ( addr : A ) -> Result < UnixStream > { let reactor = crate :: executor ( ) . reactor ( ) ; let socket = Socket :: new ( Domain :: unix ( ) , Type :: stream ( ) , None ) ? ; let addr = SockAddr :: new_unix ( addr . as_ref ( ) ) . map_err ( | e | io :: Error :: new ( io :: ErrorKind :: Other , e ) ) ? ; let source = reactor . connect ( socket . as_raw_fd ( ) , addr ) ; source . collect_rw ( ) . await ? ; Ok ( Self { stream : GlommioStream :: from ( socket ) , } ) }
Creates a Unix connection to the specified endpoint.
Creates a Unix connection to the specified endpoint .
addr
A
addr
A
examples
```no_run
use glommio::{net::UnixStream, LocalExecutor}.

let ex = LocalExecutor::default();
ex.run(async move {
UnixStream::connect("/tmp/named").await.unwrap();
})
```
` ` ` no_run use glommio :: { net :: UnixStream LocalExecutor } . let ex = LocalExecutor :: default () ; ex . run ( async move { UnixStream :: connect ( " / tmp / named " ) . await . unwrap () ; } ) ` ` `