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