Skip to content

Commit

Permalink
Retries for MAC
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesLorenz committed Dec 3, 2023
1 parent bdff97c commit 4644f94
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/address.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,23 @@ int lo_address_resolve(lo_address a)
#endif
hints.ai_socktype =
a->protocol == LO_UDP ? SOCK_DGRAM : SOCK_STREAM;

if ((ret = getaddrinfo(host, lo_address_get_port(a), &hints, &ai))) {
a->errnum = ret;
a->errstr = gai_strerror(ret);
a->ai = NULL;
a->ai_first = NULL;
return -1;
}

if (getaddrinfo(host, lo_address_get_port(a), &hints, &ai)) {
usleep(100000);
if (getaddrinfo(host, lo_address_get_port(a), &hints, &ai)) {
usleep(200000);
if (getaddrinfo(host, lo_address_get_port(a), &hints, &ai)) {
usleep(400000);
if ((ret = getaddrinfo(host, lo_address_get_port(a), &hints, &ai))) {
a->errnum = ret;
a->errstr = gai_strerror(ret);
a->ai = NULL;
a->ai_first = NULL;
return -1;
}
}
}
}
a->ai = ai;
a->ai_first = ai;
}
Expand Down

0 comments on commit 4644f94

Please sign in to comment.