pub async fn socket_pair() -> DynResult< (TcpStream, TcpStream) >
	{
		// port 0 = let the OS choose
		//
		let listener = TcpListener::bind("127.0.0.1:0").await?;
		let stream1  = TcpStream::connect(listener.local_addr()?).await?;
		let stream2  = listener.accept().await?.0;

		Ok( (stream1, stream2) )
	}
/// Creates a connected pair of sockets.
/// Uses tokio tcp stream. This will only work if the reactor is running.
//
Creates a connected pair of sockets.
Uses tokio tcp stream. This will only work if the reactor is running.
Creates a connected pair of sockets . Uses tokio tcp stream . This will only work if the reactor is running .
pub async fn socket_pair() -> DynResult< (TcpStream, TcpStream) >
	{
		// port 0 = let the OS choose
		//
		let listener = TcpListener::bind("127.0.0.1:0").await?;
		let stream1  = TcpStream::connect(listener.local_addr()?).await?;
		let stream2  = listener.accept().await?.0;
		Ok( (stream1, stream2) )
	}
pub async fn socket_pair ( ) -> DynResult < ( TcpStream , TcpStream ) > { // port 0 = let the OS choose // let listener = TcpListener :: bind ( " " ) . await ? ; let stream1 = TcpStream :: connect ( listener . local_addr ( ) ? ) . await ? ; let stream2 = listener . accept ( ) . await ? . 0 ; Ok ( ( stream1 , stream2 ) ) }
Creates a connected pair of sockets.
Creates a connected pair of sockets .