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