From 9a6c480290b9b0b2bb605e2d218ac210cfa0e99b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 4 May 2017 11:56:07 +0200 Subject: [PATCH] [update] ctrlTerm timeout to 10sec --- central-manager/lib/header.h | 1 + central-manager/lib/local/middleware.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/central-manager/lib/header.h b/central-manager/lib/header.h index 38c36cc..1a75e89 100644 --- a/central-manager/lib/header.h +++ b/central-manager/lib/header.h @@ -52,6 +52,7 @@ #define maxHostLen 64 #define maxPortLen 6 + #define CTRL_TIMEOUT 10 // 10sec timeout (pour ctrlTerm) #define SOCK_TIMEOUT 4 // 4sec timeout (1+ temps refresh plane) #define PUBL_TIMEOUT 2 // 2sec entre chaque publication sur multicast UDP (pour avions) diff --git a/central-manager/lib/local/middleware.c b/central-manager/lib/local/middleware.c index 5bc94c5..3c425c6 100644 --- a/central-manager/lib/local/middleware.c +++ b/central-manager/lib/local/middleware.c @@ -94,7 +94,14 @@ int multicastTerminal(struct middleware_arg* arg){ } /* 3. On définit un timeout (si aucune connection) */ - setTimeout(*arg->comSock, SOCK_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND); + /* 3.1. Si viewTerm -> default timeout (4sec) */ + if( strcmp(arg->entity, "udp_vterm") == 0 ) + setTimeout(*arg->comSock, SOCK_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND); + /* 3.2. Si ctrlTerm -> 10sec timeout */ + else + setTimeout(*arg->comSock, CTRL_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND); + + /* (2) Récupération port random