Re: use alarm() to achieve timeout.
- From: helloghui@xxxxxxxxx
- Date: Wed, 17 Dec 2008 05:56:22 -0800 (PST)
On Dec 17, 12:48 pm, Johannes Bauer <dfnsonfsdu...@xxxxxx> wrote:
hellog...@xxxxxxxxx schrieb:
Thanks for your reply. So you mean what I concern is right and the
implementation of timeout using alarm() from
UNP(<<unix network programming ,3rd, by Richard stevens>>)
is not perfect(the code I wrote above is from UNP)
just because of the small window between alarm() and recvfrom().
then could you please show me a correct solution to implement
timeout using alarm() when doing socket i/o?
I believe there is no safe way of implementing what you want using
alarm(2). Why do you want to use alarm anyways? Have you thought about
poll? It seems much more like what you want.
Regards,
Johannes
--
"Meine Gegenklage gegen dich lautet dann auf bewusste Verlogenheit,
verlästerung von Gott, Bibel und mir und bewusster Blasphemie."
-- Prophet und Visionär Hans Joss aka HJP in de.sci.physik
<48d8bf1d$0$7510$54022...@xxxxxxxxxxxxxxx>
yes,I think poll or select is an excellent solution to achieve timeout
when doing socket i/o. But the way using alarm() made me think a
lot.
.
- References:
- use alarm() to achieve timeout.
- From: guanghui
- Re: use alarm() to achieve timeout.
- From: David Schwartz
- Re: use alarm() to achieve timeout.
- From: guanghui
- Re: use alarm() to achieve timeout.
- From: David Schwartz
- Re: use alarm() to achieve timeout.
- From: helloghui
- Re: use alarm() to achieve timeout.
- From: Johannes Bauer
- use alarm() to achieve timeout.
- Prev by Date: Re: Apache-Proxyblock.conf -Need to block iGoogle without blocking Google
- Next by Date: Re: load-balancing twin 10GbE?
- Previous by thread: Re: use alarm() to achieve timeout.
- Next by thread: Re: use alarm() to achieve timeout.
- Index(es):
Relevant Pages
|