Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!dali.cs.montana.edu!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: <7060@milton.u.washington.edu> Date: 5 Sep 90 00:38:42 GMT References: <6964@milton.u.washington.edu> <5329@munnari.oz.au> Sender: news@milton.u.washington.edu Organization: Mendou Zaibatsu, Tomobiki-Cho, Butsumetsu-Shi Lines: 59 In article <5329@munnari.oz.au> kre@cs.mu.OZ.AU (Robert Elz) writes: >There was a time when building network names into the filesystem >was seen as a sensible thing to do - nice and regular, existing >programs would be able to use them, ... Yes, many dinosaur operating systems did just that. There are still a few examples of those dinosaurs, and they are running just fine with precisely that mindset. That is not the reason they are dinosaurs; more likely, the antiquity of the hardware platform is more responsible for their extinction. >Unfortunately, while its a nice idea, it really won't work in general, >and if it doesn't work in general, its not worth the effort. ^^^^^^^^^^^^^^^^^^^^^^^^ I think this is more the the point than anything else. The high priests of sockets don't think it is worth the effort to support heresy. >[lots of spurious arguments about why simple things must be made > harder than necessary] All of these problems (even DNS lookups of hosts in filenames) were solved in other operating systems. It doesn't matter *how* complicated the most complicated file specifier can be; all that matters is that the defaults are the right thing for all but the oddball cases so the simple case is simple. >Now, the easy part is solved, TCP just isn't that complex, but >lets extend generality a little and open an OSI MHS (X.400) >connection as well. X.400 is at an entirely different level (not to mention stack) from TCP. You are mixing apples with orange juice. The OSI IP stack is probably a different device from /dev/tcp, and what layers on top of it is specific to that device. >Having that >file descriptor all the necessary options can be set before the >network is asked to establish the connection Here's the rub, and the real reason why we've been made to suffer with streams. However, this is conceptually easy to solve. Make the O_NDELAY form of open with none of {O_RDONLY | O_WRONLY | O_RDWR} set to mean "give me a designator only", and then have an ioctl() call that means "establish connection on this designator". Since we allow non-blocking open with establish (implicitly above), we probably want to have all the likely functions: block until open, establish and block, establish without blocking, test if open. Summary: the simple cases should be *simple*, not made complex for a theoretical complex case. _____ | ____ ___|___ /__ 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.