pub async fn connect<A: ToSocketAddrs>(addr: A) -> Result<TcpStream> {
        let addr = addr.to_socket_addrs()?.next().unwrap();
        let (addr, socket) = make_tcp_socket(&addr)?;
        let reactor = crate::executor().reactor();
        let source = reactor.connect(socket.as_raw_fd(), addr);
        source.collect_rw().await?;

        Ok(TcpStream {
            stream: GlommioStream::from(socket),
        })
    }
/// Creates a TCP connection to the specified address.
///
/// # Examples
///
/// ```no_run
/// use glommio::{net::TcpStream, LocalExecutor};
///
/// let ex = LocalExecutor::default();
/// ex.run(async move {
///     TcpStream::connect("127.0.0.1:10000").await.unwrap();
/// })
/// ```
Creates a TCP connection to the specified address.
Creates a TCP connection to the specified address .
pub async fn connect<A: ToSocketAddrs>(addr: A) -> Result<TcpStream> {
        let addr = addr.to_socket_addrs()?.next().unwrap();
        let (addr, socket) = make_tcp_socket(&addr)?;
        let reactor = crate::executor().reactor();
        let source = reactor.connect(socket.as_raw_fd(), addr);
        source.collect_rw().await?;
        Ok(TcpStream {
            stream: GlommioStream::from(socket),
        })
    }
pub async fn connect < A : ToSocketAddrs > ( addr : A ) -> Result < TcpStream > { let addr = addr . to_socket_addrs ( ) ? . next ( ) . unwrap ( ) ; let ( addr , socket ) = make_tcp_socket ( & addr ) ? ; let reactor = crate :: executor ( ) . reactor ( ) ; let source = reactor . connect ( socket . as_raw_fd ( ) , addr ) ; source . collect_rw ( ) . await ? ; Ok ( TcpStream { stream : GlommioStream :: from ( socket ) , } ) }
Creates a TCP connection to the specified address.
Creates a TCP connection to the specified address .
addr
A
addr
A
examples
```no_run
use glommio::{net::TcpStream, LocalExecutor}.


` ` ` no_run use glommio :: { net :: TcpStream LocalExecutor } .