> I am working with UNIX Sockets and have some questions
> that I cant seem to find answers to on the web.

Since the questions was interesting enough to me, I thought
I would research the answer.  "Perl Cookbook" contains an
entire chapter on this.  I am not a socket programmer!

> 1: Are UNIX sockets bi-directional?

>From "man 2 socket" (linux):

       SOCK_STREAM
              Provides sequenced,  reliable,  two-way,  connection-based  byte
              streams.  An out-of-band data transmission mechanism may be sup-
              ported.

       SOCK_DGRAM
              Supports datagrams (connectionless,  unreliable  messages  of  a
              fixed maximum length).

If you choose PF_UNIX and SOCK_STREAM, then you would expect
something akin to TCP.  Similarly, PF_UNIX and SOCK_DGRAM
would give something akin to UDP.

So, datagrams are connectionless, and by extension are
one way.  With a datagram, a message is transferred
between processes, and that is that.

> 2: If so, what is the proper way to 'setup' the connection? ...

Try choosing SOCK_STREAM instead of SOCK_DGRAM.

> 3: Do UNIX sockets have less overhead than INET sockets?

I believe so, but the difference might not be that great.  Which
seams more appropriate?

May the man pages help you in your quest.

Jonathan Paton

-- 
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to