[comp.unix.amiga] Domain Socket

tinyguy@cs.mcgill.ca (Yeo-Hoon BAE) (01/27/91)

This may not apply to the A3000UX, but what exactly is the
'Domain socket'? I think it's only supported by Berkerley Unix.
Thanks.


+-----------------------------------------------------------+-------------+
| Yeo-Hoon Bae      tinyguy@homer.cs.mcgill.ca              | Amiga   /// |
| Dept. Computer Science, McGill University, Canada         |  2000  ///  |
|-----------------------------------------------------------|    \\\///   |
| Amiga2000 + 3MB + 104MB HD + KX-P1124 + Mit. DiamondScan  |     \XX/    |
+-----------------------------------------------------------+-------------+

dgg@ksr.com (David Grubbs) (01/29/91)

In article <1991Jan27.023818.4112@cs.mcgill.ca> tinyguy@cs.mcgill.ca (Yeo-Hoon BAE) asks:

   This may not apply to the A3000UX, but what exactly is the
   'Domain socket'? I think it's only supported by Berkerley Unix.
   Thanks.

All sockets are "Domain sockets".  The question is *which* domain.  Most
programmers use sockets in the "TCP Domain" because they work both on the
local machine and across networks.

But there are other Domains.  If you have the kernel support, there is a
socket domain available for each major networking type: XNS, ISO (though it is
handled strangely), SNA (even more strangely) and what is called the "Unix
Domain socket", to which I believe you refer.

A "Unix Domain Socket" is one which expects only to talk to processes on the
local host.  In the latest Berkeley code, a "pipe()" (invoked by using '|' in
the shell) is a unix domain socket pair.  Last time I looked, X11 allowed you
to use "unix:0.0" as a DISPLAY name and it would create Unix domain sockets
instead of the default TCP domain sockets.

Unix Domain sockets generally incur much less overhead than other kinds of
sockets, generating somewhat less "system time".

If you want to understand Amiga Unix, starting reading about Unix.
--
David G. Grubbs				Kendall Square Research Corp.
{harvard,uunet,world}!ksr!dgg		dgg@ksr.com

ford@amix.commodore.com (Mike "Ford" Ditto) (01/29/91)

In article <1991Jan27.023818.4112@cs.mcgill.ca> tinyguy@cs.mcgill.ca (Yeo-Hoon BAE) writes:
>This may not apply to the A3000UX, but what exactly is the
>'Domain socket'? I think it's only supported by Berkerley Unix.

You're probably thinking of "Unix domain" sockets, as opposed to "IP
domain" sockets.  The difference is that the IP domain uses IP
addresses to connect to a process on some machine on a network, while
the Unix domain uses Unix pathnames to connect to a process on the
same machine.

For example, you could create a server that makes a Unix domain socket
and binds it to the name "/tmp/mysocket", and other processes could
connect to it and communicate with your server.

Unix domain sockets, like sockets in general, were invented as part of
BSD Unix, and are also present in SVR4.

					-=] Ford [=-

"But everybody wants a rock		(In Real Life:  Mike Ditto)
 to wind a piece of string around."	ford@amix.commodore.com
 - They Might be Giants,		uunet!cbmvax!ditto
   "We want a rock"			ford@kenobi.commodore.com

david@twg.com (David S. Herron) (02/02/91)

In article <1991Jan27.023818.4112@cs.mcgill.ca> tinyguy@cs.mcgill.ca (Yeo-Hoon BAE) writes:
>This may not apply to the A3000UX, but what exactly is the
>'Domain socket'? I think it's only supported by Berkerley Unix.
>Thanks.

Sockets are "endpoints for communication" .. that is, they provide
a communications channel between two ports, the ports can be connected
to different processes, the same process, or to two processes on
two different systems.  The specifics depend on what kind of sockets
they are and the options you set on the socket when you open & connect it.

Unix Domain Sockets are the way BSD implemented pipes, but are more useful
than "just pipes".  There is also a "named" form of these, that is a
file system object which is one endpoint of a Unix Domain Socket, and
can be opened & read & written "just like a pipe".  It is somewhat
similar to USG's (System V) "named pipes".

Since I haven't (yet) bothered to look at any system Vr4 manuals I
can't say this for sure...

SysVr4 is supposed to have all the BSD features in there.  This should
include the Unix Domain Sockets, though they may be implemented as
a front end to named pipes.

Unix domain sockets, like pipes, only provide communication within a
single system.  If you want communication beyond a single system you
must use another addressing family.  (Unix domain sockets are just
one of the addressing families -- AF_UNIX).

In System V the preferred interface to this idea is "Transport Layer
Interface" (TLI).  It provides similar capabilities, with some interesting
differences and different terminology.


	David


-- 
<- David Herron, an MMDF & WIN/MHS guy, <david@twg.com>
<- Formerly: David Herron -- NonResident E-Mail Hack <david@ms.uky.edu>
<-
<-	MS-DOS ... The ultimate computer virus.