[comp.unix.questions] sockets library and streams

terry@eecea.eece.ksu.edu (Terry Hull) (04/26/89)

I was wondering if anyone had implemented a sockets library on top of
streams.  I want to run sockets code on a machine that has a streams
library, but no sockets library.  It will be a '386 running UNIX SysV
R3.2.  Alternatively, has anyone tried this and given up?  

Thanks in advance for your help.  



-- 
Terry Hull 
Department of Electrical and Computer Engineering, Kansas State University
Work:  terry@eecea.eece.ksu.edu, rutgers!ksuvax1!eecea!terry
Play:  tah386!terry@eecea.eece.ksu.edu, rutgers!ksuvax1!eecea!tah386!terry

dougm@ico.ISC.COM (Doug McCallum) (04/26/89)

In article <634@eecea.eece.ksu.edu> terry@eecea.eece.ksu.edu (Terry Hull) writes:
>I was wondering if anyone had implemented a sockets library on top of
>streams.  I want to run sockets code on a machine that has a streams
>library, but no sockets library.  It will be a '386 running UNIX SysV
>R3.2.  Alternatively, has anyone tried this and given up?  

I believe that All of the commercial TCP/IP packages for STREAMS have
socket interfaces.  Do you have a protocol you are using or just the
STREAMS mechanism.  STREAMS by itself does not give you a protocol to
work with.

By "streams library", do you mean TLI or just plain STREAMS system calls?

It is possible to implement most of the socket semantics with a library
but you would need at least a pushable module to hold some of the state
necessary.  If you are talking to a protocol that implements the "transport
provider interface" used by TLI, you need to map into those primitives.

Interactive's TCP/IP product implements sockets as a combination library
and pushable module that parallels the TLI module (timod).  The library
uses socket primitives and the module maps those into TPI primitives.  
here are a few places where sockets require operations to be done in a
different sequence than TLI/TPI.  There are also a few places where you
just cannot do things the same way.

So, it can be done and depending on how close you need to match semantics,
it can be done either as a "simple" library or you might need some
additional work.

		Doug McCallum
		Interactive Systems Corp.
		dougm@ico.isc.com