[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux] setsockopt SO_RCVTIMEO fonctionne ?
Qqn a déjà essayé l'option (via setsockopt) SO_RCVTIMEO
(time-out pour la réception) dans les sockets sous Linux 2.4 ?
Dans 2.2 et dans la manpage (man 7 socket), il fait mis que
c'est pas supporté par Linux, qu'il faut passer par alarm.
Mais d'après les sources du kernel (2.4.10), on dirait que c'est
bien implémenté...
D'après ce que j'ai trouvé sur une ML kernel:
"
Chris Evans: "SO_RCVTIMEO, SO_SNDTIMEO"
> I notice the entities in the subject line have appeared in Linux 2.4.
> What is their functional specification? I guess they trigger if no bytes
> are received/send within a consecutive period. How does the app get the
> error? -EPIPE for a blocking read/write? If so, does SIGPIPE
> get raised? Or is -ETIMEDOUT used? ...
They are the maximum amount of time that a send or receive call will
block for. The standard socket error returns apply, so if data has
been sent or received, then the return value will be the amount of
data transferred; if no data has been transferred and the timeout
has been reached then -1 is returned with errno=EAGAIN just as if the socket
was specified to be nonblocking. If the timeout is set to zero (the default)
then the operation will never timeout.
"
Donc on dirait que ça fonctionne bien entre-temps...
Si c'est bien le cas, c'est dommage que la man-page est out-dated sur un
truc aussi important...
--
-o) Pascal Bleser ATOS Origin/Aachen(DE) |
/\\ <pascal.bleser@atosorigin.com> |
_\_v <guru@linuxbe.org> |
---------------------------------------------|
Jesus saves,Buddha makes incremental backups :
---------------------------------------------'
_______________________________________________
Linux Mailing List
Archives: http://unixtech.be/mailman/listinfo/linux