[MPlayer-dev-eng] Re: [PATCH] recv() with timeout
Alban Bedel
albeu at free.fr
Sat Jan 10 23:22:14 CET 2004
Hi Konstantin Andreyev,
on Mon, 05 Jan 2004 14:55:37 -0500 you wrote:
> Hi,
>
> This patch prevents mplayer from indefinite wait in recv
> statement.
Nice, i wanted to fix that too since a long time.
> The indefinite wait can occure if streaming server and
> client both are waiting packets from each other.
If that case occur, there's a flaw in the implementation or
the protocle. However in reallity if often happend that
the remote end die, timeout bcs of too long pause, etc
However i don't really like the patch. Calling fcntl before
and after every recv call is nonsense imho. You set the socket
blocking or not. Also MSG_DONTWAIT can simply be set in the
recv flags instead iirc.
Btw why do you set it non-blocking after select ? I know that
accept can block even after select, but recv shouldn't afaik.
Anyway if you do set it non-blocking, in case of error you should
check errno for EAGAIN and return 0 or retry in such case.
Imho there's no need to add another file that will just
contain a single function. Isn't it possible to just put it in
network.c like other network helpers ?
Finnaly did you really tested everything ? No offence but this
look to me as some blind search/replace, so i want to make sure
that it's really tested.
Albeu
--
Everything is controlled by a small evil group
to which, unfortunately, no one we know belongs.
More information about the MPlayer-dev-eng
mailing list