home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4582 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.4 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: writing servers
  5. Date: 9 Sep 1992 08:23:31 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 24
  8. Distribution: usa
  9. Message-ID: <18kca3INNr52@early-bird.think.com>
  10. References: <1992Sep8.230315.2621@nic.csu.net>
  11. NNTP-Posting-Host: gandalf.think.com
  12.  
  13. In article <1992Sep8.230315.2621@nic.csu.net> vpopesc@opus.uucp (Gov. Wilson Sucks) writes:
  14. >[Hope this doesn't go out in multiplicate. Having posting problems]
  15.  
  16. There were four copies of the message in the one posting.  Is that what you
  17. meant?
  18.  
  19. > How can I detect if there is activity for the server to process? I
  20. > would like it to be idle as long as it has nothing to do. But all
  21. > I could do was to put it in an infinite loop. And that made it
  22. > eat up 80% cpu, which is prolly unacceptable.
  23.  
  24. Use select(2) or poll(2), depending on the flavor of Unix you have, to wait
  25. for activity on any of the sockets.
  26.  
  27. > 2. Can anyone suggest literature on the subject. All I could find was
  28. >    books that examined the functions taken apart. How about one that
  29. >    says "Ok, here's what goes into writteing a server" ? 
  30.  
  31. "Unix Network Programming" by W.Richard Stevens.  It has complete examples.
  32. -- 
  33. Barry Margolin
  34. System Manager, Thinking Machines Corp.
  35.  
  36. barmar@think.com          {uunet,harvard}!think!barmar
  37.