version 1.28, 2011/03/12 15:32:03
|
version 1.28.2.5, 2011/04/18 08:40:11
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.0.21 |
RPL/2 (R) version 4.0.23 |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
Copyright (C) 1989-2011 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
Line 903 instruction_read(struct_processus *s_eta
|
Line 903 instruction_read(struct_processus *s_eta
|
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
|
if ((*s_etat_processus).affichage_arguments == 'Y') |
if ((*s_etat_processus).affichage_arguments == 'Y') |
{ |
{ |
printf("\n READ "); |
printf("\n READ "); |
Line 2065 instruction_read(struct_processus *s_eta
|
Line 2062 instruction_read(struct_processus *s_eta
|
} |
} |
# endif |
# endif |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
for(;;) |
for(;;) |
{ |
{ |
if ((*((struct_socket *) (*s_objet_argument_1).objet)) |
if ((*((struct_socket *) (*s_objet_argument_1).objet)) |
Line 2097 instruction_read(struct_processus *s_eta
|
Line 2097 instruction_read(struct_processus *s_eta
|
tampon_lecture, longueur_questure, |
tampon_lecture, longueur_questure, |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *) |
&adresse_ipv6, &longueur_adresse); |
&adresse_ipv6, &longueur_adresse); |
|
|
# else |
# else |
if ((*s_etat_processus).langue == 'F') |
if ((*s_etat_processus).langue == 'F') |
{ |
{ |
Line 2139 instruction_read(struct_processus *s_eta
|
Line 2140 instruction_read(struct_processus *s_eta
|
if (longueur_effective < 0) |
if (longueur_effective < 0) |
{ |
{ |
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
} |
} |
|
|
|
// Une donnée a été reçue. |
|
|
if (((*s_etat_processus).var_volatile_requete_arret == -1) |
if (((*s_etat_processus).var_volatile_requete_arret == -1) |
|| (longueur_effective >= 0)) |
|| (longueur_effective >= 0)) |
{ |
{ |
Line 2353 instruction_read(struct_processus *s_eta
|
Line 2357 instruction_read(struct_processus *s_eta
|
longueur_adresse = 0; |
longueur_adresse = 0; |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
longueur_effective, MSG_DONTWAIT, |
NULL, &longueur_adresse); |
NULL, &longueur_adresse); |
|
|
(*s_objet_adresse).objet = NULL; |
(*s_objet_adresse).objet = NULL; |
Line 2364 instruction_read(struct_processus *s_eta
|
Line 2368 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_ipv4); |
longueur_adresse = sizeof(adresse_ipv4); |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
longueur_effective, MSG_DONTWAIT, |
(struct sockaddr *) &adresse_ipv4, &longueur_adresse); |
(struct sockaddr *) &adresse_ipv4, &longueur_adresse); |
|
|
if (((*s_objet_adresse).objet = |
if (((*s_objet_adresse).objet = |
Line 2444 instruction_read(struct_processus *s_eta
|
Line 2448 instruction_read(struct_processus *s_eta
|
longueur_adresse = sizeof(adresse_ipv6); |
longueur_adresse = sizeof(adresse_ipv6); |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
position_finale, MSG_DONTWAIT, |
longueur_effective, MSG_DONTWAIT, |
(struct sockaddr *) &adresse_ipv6, &longueur_adresse); |
(struct sockaddr *) &adresse_ipv6, &longueur_adresse); |
|
|
if (((*s_objet_adresse).objet = |
if (((*s_objet_adresse).objet = |
Line 2569 instruction_read(struct_processus *s_eta
|
Line 2573 instruction_read(struct_processus *s_eta
|
} |
} |
# endif |
# endif |
|
|
|
attente.tv_sec = 0; |
|
attente.tv_nsec = GRANULARITE_us * 1000; |
|
|
for(;;) |
for(;;) |
{ |
{ |
if ((*((struct_socket *) (*s_objet_argument_1).objet)) |
if ((*((struct_socket *) (*s_objet_argument_1).objet)) |
Line 2643 instruction_read(struct_processus *s_eta
|
Line 2650 instruction_read(struct_processus *s_eta
|
if (longueur_effective < 0) |
if (longueur_effective < 0) |
{ |
{ |
nanosleep(&attente, NULL); |
nanosleep(&attente, NULL); |
|
INCR_GRANULARITE(attente.tv_nsec); |
scrutation_injection(s_etat_processus); |
scrutation_injection(s_etat_processus); |
} |
} |
|
|
Line 2790 instruction_read(struct_processus *s_eta
|
Line 2798 instruction_read(struct_processus *s_eta
|
|
|
/* |
/* |
* Les informations concernant la cible sont valides si |
* Les informations concernant la cible sont valides si |
* la socket est non connectée et des domaines INET ou INET6. |
* la socket est non connectée et que les domaines sont |
|
* INET ou INET6. |
* Dans tous les autres cas, on renvoie une liste vide. |
* Dans tous les autres cas, on renvoie une liste vide. |
*/ |
*/ |
|
|
Line 2800 instruction_read(struct_processus *s_eta
|
Line 2809 instruction_read(struct_processus *s_eta
|
(strcmp((*((struct_socket *) (*s_objet_argument_1).objet)) |
(strcmp((*((struct_socket *) (*s_objet_argument_1).objet)) |
.type, "SEQUENTIAL DATAGRAM") == 0)) |
.type, "SEQUENTIAL DATAGRAM") == 0)) |
{ |
{ |
|
// POSITION_FINALE peut être utilisée sans être initialisée ! |
|
// virer position_finale pour longueur_effective |
longueur_adresse = 0; |
longueur_adresse = 0; |
recvfrom((*((struct_socket *) |
recvfrom((*((struct_socket *) |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |
(*s_objet_argument_1).objet)).socket, tampon_lecture, |