J'ai lu ceci au sujet du réglage d'un socket en mode non-bloquant.Comment réinitialiser une socket en mode blocage (après l'avoir réglée en mode non bloquant)?
http://www.gnu.org/software/libc/manual/html_mono/libc.html#File-Status-Flags
Voici ce que je faisais:
static void setnonblocking(int sock)
{
int opts;
opts = fcntl(sock,F_GETFL);
if (opts < 0) {
perror("fcntl(F_GETFL)");
exit(EXIT_FAILURE);
}
opts = (opts | O_NONBLOCK);
if (fcntl(sock,F_SETFL,opts) < 0) {
perror("fcntl(F_SETFL)");
exit(EXIT_FAILURE);
}
return;
}
Comment puis-je régler la prise de retour en mode de blocage? Je ne vois pas de drapeau O_BLOCK?
Merci.
Voir si [cette réponse] (http://stackoverflow.com/a/18307077/514235) aide. – iammilind