*BSD News Article 92179


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!worldnet.att.net!news.mathworks.com!enews.sgi.com!news.corp.sgi.com!news.sgi.com!news.sprintlink.net!news-stk-200.sprintlink.net!news-pull.sprintlink.net!news.sprintlink.net!news-ana-7.sprintlink.net!news.tcd.net!not-for-mail
From: Wes Peters <wes@dayna.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Sys V Streams Vs. BSD Sockets
Date: Fri, 28 Mar 1997 16:36:32 -0700
Organization: Dayna Communications
Lines: 31
Message-ID: <333C5600.2D7C@dayna.com>
References: <5h4rte$92a@news.interlog.com> <33383E63.754@cet.co.jp>
Reply-To: wes@dayna.com
NNTP-Posting-Host: 192.206.100.199
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01Gold (WinNT; I)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:37947

Paul Griffith asked:
% I know this is a generic Unix question (if there is such a thing), but
% where can I find a FAQ on the major differences in streams and sockets
% ? Is one better for some tasks ??

Mike Hancock replied: 
> I don't know if there's a FAQ for this.
> 
> The interfaces are similar, but the semantics are very different.  For
> example sockets return errors synchronously while in streams errors are
> usually returned asynchronously.
> 
> Streams can be parallelized easier on SMP systems, but streams
> implementations typically also have more overhead than sockets.
> 
> You should get some books on Unix programming.  Richard Stevens' books
> cover mostly sockets.  Steve Rago wrote a book on SYSV that probably
> covers streams.  For a general survey of various Unix systems read, Unix
> Internals: The New Frontiers, by Uresh Vahalia.

There are some large differences; "STREAMS" covers a lot more than just
the SVR4 TCP/IP Transport Layer Interface (tli).  W. Richard Stevens
does a pretty good job of comparing the SVR4 network and IPC systems
to the Berkeley sockets interfaces in his books _Advanced Programming
in the UNIX Environment_.

-- 
Wes Peters                          It was a diamond as big as the Ritz
Software Engineer                  What you gonna do with this, tell me
Dayna Communications        Who's gonna save you when you're a slave to
                                           A diamond as big as the Ritz