From ac27da70ea27677c055a4c226f959b594c50deff 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: e558c09badab3d566c38e039b06586f5397efd46 Former-commit-id: 2d60a0b33f01d5f43539db6744ccb2fdac58fef1 --- 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; + } } /*