mapper: Retry if mapper is unavailable
Sometimes mapper waits begin executing before the mapper is available to
respond to requests. This will result in a EHOSTUNREACH being returned
by the broker. We always want to retry and see if the broker becomes
available in these cases.
Change-Id: Id3576ddc7e82904bb55062e63506042bec826983
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/libmapper/app.c b/libmapper/app.c
index 534ea7e..45173bb 100644
--- a/libmapper/app.c
+++ b/libmapper/app.c
@@ -91,7 +91,7 @@
{
fprintf(stderr, "Event loop exited: %s\n", strerror(-r));
- if (-r == ETIMEDOUT)
+ if (-r == ETIMEDOUT || -r == EHOSTUNREACH)
{
if (attempts <= max_attempts)
{