Re: Full sample for select()



On 2006-03-30, Alex Vinokur <alexvn@xxxxxxxxxxxxxxxxxxxxx> wrote:
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.

--
Minds, like parachutes, function best when open
.



Relevant Pages

  • Re: Full sample for select()
    ... I guess you've never done networking programming with TCP sockets. ...
    (comp.unix.programmer)
  • Re: Structures question.
    ... SOAP? ... TCP? ... Remoting? ... "Programming is an art form that fights back" Develop ASP.NET applications easier and in less time: ...
    (microsoft.public.dotnet.languages.csharp)
  • Suggestions on how to handle this more efficiently
    ... I have just started programming in c on freeBSD. ... Beej's Guide to network programming, ... first program, a tcp based 1 on one chat client and server. ...
    (comp.unix.programmer)