home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / protocol / tcpip / ibmpc / 5065 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  2.7 KB

  1. Path: sparky!uunet!aspentec!tto
  2. From: tto@aspentec.com
  3. Newsgroups: comp.protocols.tcp-ip.ibmpc
  4. Subject: Re: TSRs ...
  5. Message-ID: <1992Sep4.125443.865@aspentec.com>
  6. Date: 4 Sep 92 12:54:43 EST
  7. References: <Btx5J4.2tD@watserv1.uwaterloo.ca> <1992Sep2.130319.862@aspentec.com>  <1873f3INNk31@seven-up.East.Sun.COM>
  8. Distribution: world
  9. Organization: Aspen Technology, Inc. Cambridge, MA.
  10. Lines: 43
  11.  
  12. In article <1873f3INNk31@seven-up.East.Sun.COM>, 
  13.  geoff@tyger.Eng.Sun.COM (Geoff Arnold @ Sun BOS - R.H. coast near the top) writes:
  14.  
  15. > In the case of PC-NFS, the reason you have to switch to the owner's
  16. > PSP is because our socket handles are real file descriptors - you can
  17. > read and write them using DOS calls. (When you referred earlier to
  18. > FTP's "global file descriptors" you should have called them "private
  19. > non-file socket descriptors".)
  20.  
  21. Yes, I was over-simplifying things a little bit.  They are not compatible
  22. with DOS' file descriptors but they are global nonetheless (i.e., they can be
  23. used by any process).
  24.  
  25. > Now you can argue whether or not having
  26. > sockets be "real files" is more useful than having the freedom to
  27. > manipulate descriptors at will - it certainly takes a lot of extra
  28. > work on our part - but we found that we had a lot of Unix stuff
  29. > to port which assumed that sockets were streams...
  30.  
  31. There is definitely a trade off here.  While I think Sun did a decent job
  32. in making socket descriptors look like DOS file descriptors, I tend to agree
  33. with Erick that since [real mode] memory is such a premium in DOS, the less
  34. code the better.  As for porting code from Unix, if one is not using high
  35. level procedures such as fprintf(), wouldn't something like "#define
  36. read(...) socket_read(...)" be sufficient?
  37.  
  38. > And if sockets
  39. > are (DOS) files, then you can't get around the need to switch PSP's.
  40.  
  41. For the general readers: there is actually a fairly easy way to share DOS
  42. file descriptors without switching PSPs.  E.g., say that process B needs to
  43. access process A's file descriptor <i>.  One can look up the <i>th slot in the
  44. descriptor table in A's PSP and copy the _global_ file descriptor stored there
  45. into an unused slot (say, the <j>th slot) in B's descriptor table.  Now process
  46. B can access the file via file descriptor <j>.  NB: Use with caution.
  47.  
  48. Tak.
  49. -----------------------------------------------------------------------------
  50. Tak To                                                    (617) 497-9020 x377
  51. Aspen Technology, Inc                                Fax: (617) 497-7806
  52. 243 Vassar St, Cambridge, Ma 02139.                       tto@aspentec.com
  53. -----------------------------------------------------------------------------
  54. "The best operating system?  ITS, of course!"                       alt-alt-u
  55.