[update] verbose timeout set up for udp COM sockets

This commit is contained in:
xdrm-brackets 2017-05-04 12:10:55 +02:00
parent 05a59c772c
commit 5b7d7d5c80
1 changed files with 11 additions and 4 deletions

View File

@ -95,11 +95,18 @@ int multicastTerminal(struct middleware_arg* arg){
/* 3. On définit un timeout (si aucune connection) */
/* 3.1. Si viewTerm -> default timeout (4sec) */
if( strcmp(arg->entity, "udp_vterm") == 0 )
setTimeout(*arg->comSock, SOCK_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND);
if( strcmp(arg->entity, "udp_vterm") == 0 ){
if( setTimeout(*arg->comSock, SOCK_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND) < 0 ){
if( DEBUGMOD&SCK ) printf("{%s} Cannot set RECV not SEND timeout\n", arg->entity);
}else
if( DEBUGMOD&SCK ) printf("{%s} SEND/RECV timeout set to %d\n", arg->entity, SOCK_TIMEOUT);
/* 3.2. Si ctrlTerm -> 10sec timeout */
else
setTimeout(*arg->comSock, CTRL_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND);
}else
if( setTimeout(*arg->comSock, CTRL_TIMEOUT, TIMEOUT_RECV|TIMEOUT_SEND) < 0 ){
if( DEBUGMOD&SCK ) printf("{%s} Cannot set RECV not SEND timeout\n", arg->entity);
}else
if( DEBUGMOD&SCK ) printf("{%s} SEND/RECV timeout set to %d\n", arg->entity, CTRL_TIMEOUT);