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