Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!mlb.semi.harris.com!thrush.mlb.semi.harris.com!del From: del@thrush.mlb.semi.harris.com (Don Lewis) Newsgroups: comp.protocols.tcp-ip Subject: Re: sockets vs. streams Message-ID: <1990Sep5.020521.803@mlb.semi.harris.com> Date: 5 Sep 90 02:05:21 GMT References: <6964@milton.u.washington.edu> <2350@cirrusl.UUCP> Sender: news@mlb.semi.harris.com Organization: Harris Semiconductor, Melbourne FL Lines: 51 In article <2350@cirrusl.UUCP> dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) writes: >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. If I have a local printer, I can send data to it by doing cat somefile >/dev/lp Now, if the printer is on a terminal server somewhere, it would sure would be nice to be able to do the same sort of thing. cat somefile >/dev/tcp/terminalserver:port or cat somefile >/dev/tcp/x.x.x.x-y.y You could even send it to two devices using tee! Specifically, you could use this for the lp= parameter in /etc/printcap so that you don't have to play funky filter games. The bottom line is that it should be possible to open connections with fopen() so that applications don't have to be modified in order to take advantage of this connectivity (assuming they don't rely on seeks and wierd ioctls that don't make sense on a network connection). -- Don "Truck" Lewis Harris Semiconductor Internet: del@mlb.semi.harris.com PO Box 883 MS 62A-028 Phone: (407) 729-5205 Melbourne, FL 32901