home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3895 < prev    next >
Encoding:
Internet Message Format  |  1992-07-24  |  1.9 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!linus!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: TCP/IP connections, how does the blocking work?
  5. Date: 24 Jul 1992 17:03:31 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 31
  8. Distribution: world
  9. Message-ID: <14pd53INNftj@early-bird.think.com>
  10. References: <13700@mindlink.bc.ca>
  11. NNTP-Posting-Host: telecaster.think.com
  12.  
  13. In article <13700@mindlink.bc.ca> Frank@mindlink.bc.ca (Frank I. Reiter) writes:
  14. >If the originating process attempts to write a few megabytes more than the
  15. >receiving process has read, will it block, what causes it to block, and how far
  16. >ahead is it likely to get before it does block?
  17. >
  18. >I want to make sure I will not be placing undo stress on the receiving machine
  19. >by causing it to try to buffer data not yet read by the process it is intended
  20. >for.  Can the receiving machine cause the sending machine to cause the sending
  21. >process to block?
  22.  
  23. The simple answer is "yes".  With properly functioning TCP/IP
  24. implementations, you don't have to worry about the sender sending faster
  25. than the receiver can handle.
  26.  
  27. The receiving machine provides a "window" to the sender, which is (to
  28. simplify greatly) the amount of data it may send before waiting for an
  29. acknowledgement.  If the receiving machine is buffering data that the
  30. process hasn't yet read, it will normally reduce the window and stop
  31. acknowledging, to tell the sender not to send any more.  When room in the
  32. buffers becomes available it will open the window and the sender can start
  33. again.
  34.  
  35. On the sending machine, when it has reached the limit specified by the
  36. window, the kernel will start buffering data locally.  When these kernel
  37. buffers fill up, the sending process will be blocked.
  38.  
  39. -- 
  40. Barry Margolin
  41. System Manager, Thinking Machines Corp.
  42.  
  43. barmar@think.com          {uunet,harvard}!think!barmar
  44.