Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!ogicse!unicorn!milton!Tomobiki-Cho!mrc From: mrc@Tomobiki-Cho.CAC.Washington.EDU (Mark Crispin) Newsgroups: comp.protocols.tcp-ip Subject: Re: sockets vs. streams Message-ID: <6969@milton.u.washington.edu> Date: 31 Aug 90 22:52:32 GMT References: <6964@milton.u.washington.edu> <13526@mentor.cc.purdue.edu> Sender: news@milton.u.washington.edu Organization: Mendou Zaibatsu, Tomobiki-Cho, Butsumetsu-Shi Lines: 89 I'm not convinced how much of this belongs in comp.protocols.tcp-ip as opposed to a Unix discussion list. This whole discussion must seem absurd to someone using something other than Unix. In article <13526@mentor.cc.purdue.edu> dls@mentor.cc.purdue.edu (David L Stevens) writes: > I don't want to get into a religious war, but I don't see where a >filesystem analogy to sockets holds up to any but the most shallow >interpretation. Strange how many "shallow" non-Unix operating systems which accessed TCP through the filesystem exist. Are you familiar with any of them? They did it quite cleanly. >To use your naming, what does it mean if I type: > cd /tcp//128.210.10.8 >? Nothing in particular. It can be a no-op or some sort of invalid I/O operation. > What if I do an "ls /tcp"? You get whatever you get when you open the file "/tcp" for read and attempt to interpret it as a disk directory. Remember, ls is just a user program. If you were really clever, perhaps the file "/tcp" could contain a netstat-type report. >Be careful-- all of the assigned addresses >aren't available in any one place. Not if NIC.DDN.MIL-- they only have the >network parts... Irrelevant. At most, the directory /tcp would have the currently open connections as its members. > How do you specify a local address binding when you care? How do you >specify that you don't care? Encode it in the filename as well, e.g. /tcp/FH-FP-LH-LP format where any field can be blank and trailing hyphens can be omitted. >What does a "seek" mean on a socket? Either a no-op or some sort of invalid I/O error. >How do you send urgent data in TCP? Most user programs don't do so often, so an ioctl() of some sort is alright. > In a UNIX implementation, by making the "tcp" a directory, you've >introduced a type of pseudo-device like no other that exists and without >it you lose some of the information you want in the name. What you're really saying is that those of your religion don't want to support unit-record file I/O and will if necessary rewrite history to "prove" the argument that it's "meaningless". > I won't argue that sockets are the "right" way, and there are certainly >rough edges, but the filesystem analagy *is* artificial. Well, then, let's get rid of the /dev kludge and have a special mechanism for every different device. We've already started on that golden path by having sockets and streams to do the same thing. Let's see, we can rewind tapes but not printers, I guess we need a different mechanism for each of these too... Which reminds me. Even if you didn't want to encode the connection parameters in the filename, you still could have had had /dev/tcp and then some ioctl to open the connection. No need for any new system calls (socket(), connect(), listen(), etc.) >The things you do to >files (ie, storage devices) aren't the things you do with sockets (ie, >communication media). Strange, I distinctly remember doing the exact same things with storage devices that I do with communications media. It was real neat, since I could use I/O redirection for debugging or multiple-use software. "Those who forget the past are condemned to repeat it." _____ | ____ ___|___ /__ Mark ("Gaijin") Crispin "Gaijin! Gaijin!" _|_|_ -|- || __|__ / / R90/6 pilot, DoD #0105 "Gaijin ha doko?" |_|_|_| |\-++- |===| / / Atheist & Proud "Niichan ha gaijin." --|-- /| |||| |___| /\ (206) 842-2385/543-5762 "Chigau. Gaijin ja nai. /|\ | |/\| _______ / \ MRC@CAC.Washington.EDU Omae ha gaijin darou" / | \ | |__| / \ / \"Iie, boku ha nihonjin." "Souka. Yappari gaijin!" Hee, dakedo UNIX nanka wo tsukatte, umaku ikanaku temo shiranai yo.