Fix timeout at tcp::connect

This commit is contained in:
OdnetninI (Eduardo José Gómez Hernández)
2023-09-18 23:34:41 +02:00
committed by Christoffer Lerno
parent cbdc746c9d
commit 05c2737f46

View File

@@ -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)