Re: Full sample for select()




"Andrei Voropaev" <avorop@xxxxxxx> wrote in message news:e0it6a$bum$2@xxxxxxxxxxxxxxxxxxx
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.

[snip]

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



.



Relevant Pages

  • Re: Full sample for select()
    ... I guess you've never done networking programming with TCP sockets. ... then after filling up your TCP buffers you won't be ...
    (comp.unix.programmer)
  • Re: RMI vs. Sockets vs. ?
    ... RMI is easier than socket programming, ... But sockets can help to connect with application written ... Neglecting for a microsecond the labor cost of creating the apps, by the time you compare the parsing, error-handling and related tasks for a custom message infrastructure against a SOAP-based one with, say Apache and Sun tools, you may find that message sizes are not quite so different, and processing costs closer still. ... Undoubtedly SOAP messages would require more bytes than "equivalent" custom-format compact messages; I'd be dubious of claims that there are significant differences in "speed" once a message reaches its destination. ...
    (comp.lang.java.programmer)
  • Re: C Sockets Newbie: Easy question
    ... If this is an exam question for a sockets course, ... either the file descriptor of the open file (which is a small number ... "Unix Network Programming" by Stevens. ...
    (comp.unix.programmer)
  • Re: Question about CSocket::Receive()
    ... you should not be using synchronous sockets for any purpose. ... It is the nature of TCP/IP that later bytes will not be lost; ... and return the segment up to the terminator; if no terminator was found, ... Receive), etc., but this is all just straightforward programming. ...
    (microsoft.public.vc.mfc)
  • Re: Batch connection to CSKL (was: Trigger CICS transaction from Batch Job)
    ... You can find the fine manual that describes the CICS side of such at z/OS ... in z/OS Communications Server IP Sockets Application Programming Interface ... transaction) that makes managing a listener in CICS quite simple and effective. ... All you need to do is to code the child server transaction in your programming ...
    (bit.listserv.ibm-main)