From df6aad2be4c6c5d11483f20e62d41e71f0ac989e Mon Sep 17 00:00:00 2001 From: hozan23 Date: Wed, 13 Mar 2024 12:33:34 +0100 Subject: net: major cleanup and improvement of the crate api --- net/src/transports/tcp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/src/transports/tcp.rs') diff --git a/net/src/transports/tcp.rs b/net/src/transports/tcp.rs index af50c10..21fce3d 100644 --- a/net/src/transports/tcp.rs +++ b/net/src/transports/tcp.rs @@ -71,7 +71,7 @@ impl ConnListener for TcpListener { } /// Connects to the given TCP address and port. -pub async fn dial_tcp(endpoint: &Endpoint) -> Result { +pub async fn dial(endpoint: &Endpoint) -> Result { let addr = SocketAddr::try_from(endpoint.clone())?; let conn = TcpStream::connect(addr).await?; conn.set_nodelay(true)?; @@ -79,7 +79,7 @@ pub async fn dial_tcp(endpoint: &Endpoint) -> Result { } /// Listens on the given TCP address and port. -pub async fn listen_tcp(endpoint: &Endpoint) -> Result { +pub async fn listen(endpoint: &Endpoint) -> Result { let addr = SocketAddr::try_from(endpoint.clone())?; let listener = TcpListener::bind(addr).await?; Ok(listener) -- cgit v1.2.3