Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!mips!apple!olivea!tymix!cirrusl!sungraph!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.protocols.tcp-ip Subject: Re: sockets vs. streams Message-ID: <2350@cirrusl.UUCP> Date: 1 Sep 90 08:28:35 GMT References: <6964@milton.u.washington.edu> Sender: news@cirrusl.UUCP Lines: 33 In <6964@milton.u.washington.edu> mrc@Tomobiki-Cho.CAC.Washington.EDU (Mark Crispin) writes: >If "network I/O looks like local device I/O" under Unix then when the >h*ll do I have to worry about all the socket or streams crap? I think the confusion in this discussion is between reading and writing on the one hand and opening the connection on the other hand. Once a virtual circuit has been set up, the socket mechanism becomes transparent to the extent networking will allow. Setting up the virtual circuit does require more steps than opening a device or file. I find this fairly understandable, because the BSD socket interface gives you LOTS of options, and it was designed to be independent of the underlying transport mechanism. >If I want to connect to port 0.143 on host 128.95.112.69, why can't I >do something like > open ("/tcp/128.95.112.69-0.143",O_RDWR|O_CREAT,0);... Like somebody said, it would be nice if there was a library routine that would make this easy. I suppose the open() system call could also do this, but then there might be too much functionality in a single system call, because it would have to understand all possible protocols and possibly accept additional parameters for the different types of sockets and connections that are possible. Quick! Get a copy of Stevens's book on UNIX network programming. The socket mystery will be gone for ever. -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi