From f860c8af0a5fe589f6d014d37ad4aa3548fd335c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 4 May 2017 11:03:19 +0200 Subject: [PATCH] [update] Feedback management (to notice viewTerm crash) added (1 byte: 0x10) --- central-manager/lib/local/handler.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/central-manager/lib/local/handler.c b/central-manager/lib/local/handler.c index 0a18395..2c7827a 100644 --- a/central-manager/lib/local/handler.c +++ b/central-manager/lib/local/handler.c @@ -261,6 +261,19 @@ void* manageViewTerm(void* THREADABLE_ARGS){ } + /* [4] Réception feedback + =========================================================*/ + /* 1. Réception feedback (0x10) */ + len = sizeof(struct sockaddr_in); + sent = recvfrom(arg->socket, buffer, 1, 0, (struct sockaddr*) &clientInfo, &len); + + /* 2. Gestion erreur (erreur ou mauvais feedback != 0x10) */ + if( sent <= 0 || buffer[0] != 0x10 ){ + printf("{udp_vterm}{com}(%d) Unable to recv feedback -> exiting\n", index); + break; + } + + /* [4] Timeout =========================================================*/ sleep(PUBL_TIMEOUT);