From 05c2737f464b4bfe5df514ac3a841e62077228cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?OdnetninI=20=28Eduardo=20Jos=C3=A9=20G=C3=B3mez=20Hern?= =?UTF-8?q?=C3=A1ndez=29?= Date: Mon, 18 Sep 2023 23:34:41 +0200 Subject: [PATCH] Fix timeout at tcp::connect --- lib/std/net/tcp.c3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/net/tcp.c3 b/lib/std/net/tcp.c3 index 3d5d59cd1..eadf83c86 100644 --- a/lib/std/net/tcp.c3 +++ b/lib/std/net/tcp.c3 @@ -11,9 +11,9 @@ fn TcpSocket! connect(String host, uint port, Duration timeout = 0, SocketOption defer os::freeaddrinfo(ai); if (timeout > 0) { - return connect_to(ai, ...options); + return (TcpSocket)net::connect_with_timeout_from_addrinfo(ai, options, timeout)!; } - return (TcpSocket)net::connect_with_timeout_from_addrinfo(ai, options, timeout)!; + return connect_to(ai, ...options); } fn TcpSocket! connect_async(String host, uint port, SocketOption... options, IpProtocol protocol = UNSPECIFIED)