linger flag seems to work now

This commit is contained in:
2025-05-22 23:30:01 +02:00
parent 94085f5bb2
commit 64ac4ba5e0
4 changed files with 21 additions and 18 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/26 19:54:25 by tomoron #+# #+# */
/* Updated: 2025/05/22 15:24:43 by tomoron ### ########.fr */
/* Updated: 2025/05/22 23:01:33 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -85,7 +85,7 @@ int ping_host(t_settings *set, char *host)
usleep(100);
receive_icmp(set, info, &wl, &stats);
}
while(wl && !g_stop)
while(wl && !g_stop && timediff(&set->last_send_time) < set->linger)
receive_icmp(set, info, &wl, &stats);
ping_end_print(set, host, &stats);
freeaddrinfo(info);