Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!iuvax!noose.ecn.purdue.edu!en.ecn.purdue.edu!milton From: milton@ecn.purdue.edu (Milton D Miller) Newsgroups: comp.protocols.tcp-ip Subject: Re: sockets vs. streams Summary: using open() to create socket -- not so bad Message-ID: <1990Aug31.220944.20749@ecn.purdue.edu> Date: 31 Aug 90 22:09:44 GMT References: <6964@milton.u.washington.edu> <13526@mentor.cc.purdue.edu> Organization: Purdue University Engineering Computer Network Lines: 69 The thing that came to my mind when I first saw this thread was the multiplexed character driver in AIX. This is basically a special file, but allows additional path name component(s) can be added, which get passed to the driver. (For those who don't know, AIX is IBM's name for UNIX.) With that in mind, let me respond: 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. To use your naming, what does it mean if I type: > > cd /tcp//128.210.10.8 >? You get 'Not A Directory', just like any other multiplexed character device. > What if I do an "ls /tcp"? 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... Same as above, you see a character special multiplexed file. Someone will probably say you should get a list of all currently known (ie in use) sockets, but there is no such model in the current AIX (you could use a special IOCTL for that, I suppose). > How do you specify a local address binding when you care? How do you >specify that you don't care? What does a "seek" mean on a socket? How do you >send urgent data in TCP? Open /tcp/whatever and use ioctl(). Seek is same as a tty, ie ignored. > 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. > AIX already has these, and are used for '/dev/hft', the 'High Function Terminal', which is the graphics head and can have 16 different sessions. In AIX 3.1, this is also used for /dev/pty, which creates a new pty if you don't specify the additional argument. > I won't argue that sockets are the "right" way, and there are certainly >rough edges, but the filesystem analagy *is* artificial. The things you do to >files (ie, storage devices) aren't the things you do with sockets (ie, >communication media). To a degree, you can make the same argument with >terminals, but it doesn't seem to be pushing it quite as much there, to me. > [note about Xinu deleted] > It doesn't surpise me that the socket interface is different, then. >I don't know if that qualifies as the explanation you wanted or not, and >perhaps there are better arguments to be made on both sides... > >-- > +-DLS (dls@mentor.cc.purdue.edu) As far as names, maybe /dev/net/tcp, that way you could also get ip, udp, etc. in the same directory. Or just leave everything in /dev. Also, you would probably want some trailing path to be an unbound socket, or would just tcp (with out an additional component) be ok? milton Milton D. Miller II ECN Consultant Disclaimer: I was a coop student at IBM.