Bonjour a tous
J'ai un souci avec cette fonction (t_optmgmt) qui me renvoie une valeur negative (donc fausse) mais je ne comprends pas pourquoi.

Voici tout d'abord le code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Option SO_REUSEADDR pour que le port specifie puisse etre reutilise	*/
				/* Structure entree			*/
memset ((char *)&st_opt_req, 0, sizeof(st_opt_req)) ;
st_opt_req.opt.len = OPTLEN(sizeof(struct opthdr) + sizeof(long)) ;
st_opt_req.opt.maxlen = sizeof(tc_opt_req) ;
st_opt_req.opt.buf = tc_opt_req ;
st_opt_req.flags = T_NEGOTIATE ;
				/* Structure rendue			*/
memset ((char *)&st_opt_ret, 0, sizeof(st_opt_ret)) ;
st_opt_ret.opt.len = 0 ;
st_opt_ret.opt.maxlen = sizeof(tc_opt_ret) ;
st_opt_ret.opt.buf = tc_opt_ret ;
st_opt_ret.flags = 0 ;
				/* Option demandee			*/
l_opt = 1 ;
pst_sockopt = (struct opthdr *)tc_opt_req ;
pst_sockopt->level = SOL_SOCKET ; 
pst_sockopt->name = SO_REUSEADDR ; 
pst_sockopt->len = OPTLEN(sizeof(long)) ; 
memcpy((char *)&pst_sockopt[1], (char *)&l_opt, pst_sockopt->len) ;
 
i_cr_tli = t_optmgmt(tfd, &st_opt_req, &st_opt_ret) ;
 
if (i_cr_tli < 0)  /* C'est le cas ! */
   {
   /* Erreur	*/
   tli_close (pst_etat_stream->fd) ;
   pst_etat_stream->etat = CP_CNX_EN_ERREUR ;
   pst_etat_stream->fd = -1 ;
   i_cr = NOK ;
   msg_ano (MACH, C_TLI_MESS_TLI, 188, (long) t_errno, (long) errno, (long) 0, (long) 0) ;
   goto fin ;
   }
else
   {
   i_cr = OK ;
   pst_etat_stream->etat = CP_CNX_SEL ;
   }
Donc, pour precision, un appel a t_open, puis t_bind se deroule au prealable normalement. C'est une fois l'appel a cette fonction t_optmgmt (fonction qui fait une modification de protocole si j'ai bien compris) qu'il y a une erreur donnée par :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
TMSCC 16/12 15:44:06 TLI   Anomalie : 188, Erreur non prevue, t_errno : 2, errno : 17
Sauriez-vous comment elucider le probleme ? Pourquoi ce t_optmgmt me retourne une erreur ???

Merci par avance