Skip to content

Commit 2d70bbd

Browse files
committed
lib/tcpip: wrap FreeRTOS_connect in timeout
1 parent 1b04573 commit 2d70bbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/tcpip/network_wrapper.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,11 @@ int network_socket_connect_tcp_internal(Timeout *timeout,
749749
server.sin_address.ulIP_IPv4 = address.ipv4;
750750
}
751751
Debug::log("Trying to connect to server");
752-
switch (FreeRTOS_connect(socket->socket, &server, sizeof(server)))
752+
switch (with_freertos_timeout(
753+
timeout, socket->socket, FREERTOS_SO_RCVTIMEO, [&] {
754+
return FreeRTOS_connect(
755+
socket->socket, &server, sizeof(server));
756+
}))
753757
{
754758
default:
755759
return -EINVAL;

0 commit comments

Comments
 (0)