home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / networki / 2093 < prev    next >
Encoding:
Text File  |  1992-11-11  |  2.1 KB  |  50 lines

  1. Newsgroups: comp.os.os2.networking
  2. Path: sparky!uunet!destroyer!gatech!news.ans.net!ans.net!db3l
  3. From: db3l@ans.net (David Bolen)
  4. Subject: Re: close-on-exec/IBM tcpip dev.kit.
  5. Sender: news@ans.net (News Administrator)
  6. Message-ID: <1992Nov11.192616.20611@ans.net>
  7. In-Reply-To: kro@kvamdata.no's message of Tue, 10 Nov 1992 08: 24:59 GMT
  8. Date: Wed, 11 Nov 1992 14:31:42 GMT
  9. References: <1992Nov10.082459.9024@kvamdata.no>
  10. Organization: Advanced Network & Services, Inc. - Elmsford, NY
  11. Lines: 37
  12.  
  13. In article <1992Nov10.082459.9024@kvamdata.no> kro@kvamdata.no (Knut Rogde) writes:
  14.  
  15. >I need to be able to set a close-on-exec flag on the sockets I open, because
  16. >the server is supposed to start new processes (which should not inherit
  17. >any descriptors).
  18. >
  19. >On the UNIX-port I can use fcntl() to set this flag, but this can't be 
  20. >done in IBM's implementation (I believe) because sockets and filedesriptors
  21. >do not come from the same domain.
  22. >
  23. >I would be grateful for any ideas...
  24.  
  25. You may not have to do anything at all. 
  26.  
  27. You are correct in that sockets and file descriptors are not the same
  28. with IBM's TCP/IP implementation (and probably others too).  Under
  29. IBM's TCP/IP, sockets are global descriptors, that are technically
  30. accessible by any process.
  31.  
  32. Your child processes won't technically inherit any sockets - although
  33. if you supply them with one, they'll be able to use it as it is global.
  34. If they allocate new sockets, they will be allocated from the global
  35. socket space, and can't overlap with the sockets the server has open.
  36.  
  37. So it isn't like an extra copy of the socket is being made for the
  38. child.  No matter how many children your server starts, when the
  39. server decides to close a socket it is using, that socket will be
  40. completely closed.
  41.  
  42. --
  43. -- David
  44. --
  45. /-----------------------------------------------------------------------\
  46.  \              David Bolen             \  Internet: db3l@ans.net      /
  47.   |   Advanced Network & Services, Inc.   \   Phone: (914) 789-5327   |
  48.  / 100 Clearbrook Road, Elmsford, NY 10523  \   Fax: (914) 789-5310    \
  49. \-----------------------------------------------------------------------/
  50.