From 345e7bf9fec73cb71f3ff069339620e9f5f83754 Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 5 Sep 2017 10:41:00 +0000 Subject: [PATCH] fixed connection wait Former-commit-id: 34c27602526346c7caa9880113cb90f6862503fe Former-commit-id: 5e1e6a73df0ad78e023d5f0ab70be9abd391ea88 --- sdl1090/view1090.REMOVED.git-id | 2 +- sdl1090/view1090.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sdl1090/view1090.REMOVED.git-id b/sdl1090/view1090.REMOVED.git-id index 7ea65f8..3988ac3 100644 --- a/sdl1090/view1090.REMOVED.git-id +++ b/sdl1090/view1090.REMOVED.git-id @@ -1 +1 @@ -07b6d82450c0a8be87c3ff832b90537a06e9cb20 \ No newline at end of file +ed63e44c0b11204e27b1007445b40aa85a15684a \ No newline at end of file diff --git a/sdl1090/view1090.c b/sdl1090/view1090.c index bceef72..50f46d2 100644 --- a/sdl1090/view1090.c +++ b/sdl1090/view1090.c @@ -309,9 +309,12 @@ int main(int argc, char **argv) { // Try to connect to the selected ip address and port. We only support *ONE* input connection which we initiate.here. c = (struct client *) malloc(sizeof(*c)); - if ((fd = setupConnection(c)) == ANET_ERR) { - fprintf(stderr, "Failed to connect to %s:%d\n", View1090.net_input_beast_ipaddr, Modes.net_input_beast_port); - exit(1); + while(1) { + if ((fd = setupConnection(c)) == ANET_ERR) { + fprintf(stderr, "Waiting on %s:%d\n", View1090.net_input_beast_ipaddr, Modes.net_input_beast_port); + } else { + break; + } } /*