home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / programm / 6057 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.8 KB

  1. Path: sparky!uunet!digex.com!intercon!udel!gatech!concert!borg.cs.unc.edu!not-for-mail
  2. From: panvalka@cs.unc.edu (Anay Panvalkar)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Re: client/server question.....
  5. Date: 27 Jan 1993 12:04:05 -0500
  6. Organization: The University of North Carolina at Chapel Hill
  7. Lines: 32
  8. Message-ID: <1k6fa5INN1m6@opsin.cs.unc.edu>
  9. References: <1993Jan26.221617.53627@slate.mines.colorado.edu>
  10. NNTP-Posting-Host: opsin.cs.unc.edu
  11.  
  12. In article <1993Jan26.221617.53627@slate.mines.colorado.edu> iarit@slate.mines.colorado.edu (ARIT ISMAIL) writes:
  13.  
  14. >I don't want to fork because the info should be generated on one
  15. >program, send to server and the server has to respond to every
  16. >program connected with the same info( if I fork, how can I transfer
  17. >that info to child?).
  18.  
  19. One solution is open a temp. file and write your info to it.
  20. Then when you fork() the child will get its own copy of the
  21. parent's descriptors. But, if the child modifies this info,
  22. it will affect any later read or writes to it by the parent.
  23.  
  24. > check_new_connection(); /* how can I check if there is any new
  25. >                           without waiting, as far as I know accept(..)
  26. >                           blocks you 'till you get some connection*/
  27.  
  28. Well, read the man page for select(2)...
  29.      Selecting true for reading on a socket descriptor upon which
  30.      a  listen(2) call has been performed indicates that a subse-
  31.      quent accept(2) call on that descriptor will not block.
  32.  
  33. >My problem is getting new connections without waiting.
  34. >I appreciate any help.
  35. >iarit@slate.mines.colorado.edu
  36.  
  37. -Anay
  38.  
  39. --
  40. ===============================================================================
  41. Anay S. Panvalkar
  42. Biomedical Engineering                  ****GO TARHEELS****
  43. University of North Carolina        
  44.