Re: Full sample for select()
- From: "Alex Vinokur" <alexvn@xxxxx>
- Date: Fri, 31 Mar 2006 18:26:56 +0300
"Andrei Voropaev" <avorop@xxxxxxx> wrote in message news:e0it6a$bum$2@xxxxxxxxxxxxxxxxxxx
On 2006-03-30, Alex Vinokur <alexvn@xxxxxxxxxxxxxxxxxxxxx> wrote:[snip]
num = select (nfds, 0, writefds, 0, 0);
if (num > 0) { // Do something }
It seems that the piece above works as
while (1) { // Do something }
If it is truth what do we reach here?
So, I guess you've never done networking programming with TCP sockets.
If you did, then your programs are broken, because if your peer for
whatever reason stops reading from the socket while your are actively
writing at your end, then after filling up your TCP buffers you won't be
able to write anything else and your program will either block, or won't
notice the problem. Even simple network congestion may result in zero
data transfer rate and your buffers will fill up.
What about UDP sockets in that context?
--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
.
- References:
- Full sample for select()
- From: Alex Vinokur
- Re: Full sample for select()
- From: Mark
- Re: Full sample for select()
- From: Andrei Voropaev
- Re: Full sample for select()
- From: Alex Vinokur
- Re: Full sample for select()
- From: Andrei Voropaev
- Full sample for select()
- Prev by Date: Re: Debugging server hanging
- Next by Date: Asynchronous DNS name resolution / DNS timeouts
- Previous by thread: Re: Full sample for select()
- Next by thread: Re: GNU Make: Is it illegal to include within targets?
- Index(es):
Relevant Pages
|