----- Original Message -----
From: Dave Kettmann <[EMAIL PROTECTED]>
Date: Thursday, December 30, 2004 5:23 pm
Subject: IO::Socket::UNIX questions
> Hello list,
Hi Dave,
>
> I am working with UNIX Sockets and have some questions that I cant
> seem to find answers to on the web.
It can be hard to find a good site on all IPC programming. Check out "Network
programing with Perl", by Lincoln Stein.
perldoc perlipc is a good start.
>
> 1: Are UNIX sockets bi-directional?
yes, SOCK_STREAM type
>
> 2: If so, what is the proper way to 'setup' the connection? (will
> post what I have below)
what you have looks correct, no need to specify Type [ SOCK_STREAM is default].
I think the problem you may have is in setting permissions on socket files.
Does the child have access priveledge to write to that file ?? what is the
UMASK or you server process ?? Post more code, and output along with debug
print umask in your server code.
>
> 3: Do UNIX sockets have less overhead than INET sockets?
That all depends, it can go both way's. UNIX sockets, is comunicatting through
files. Faster way would be to communicate through pipe's.
HTH,
Mark G.
>
> Here is what I have for the OO connections:
>
> Server:
>
> my $server = IO::Socket::UNIX->new(Local => "/tmp/mysock",
> Type => SOCK_DGRAM,
> Listen => 5 )
> or die $@;
>
> Client:
>
> my $client = IO::Socket::UNIX->new (
> Type => SOCK_DGRAM,
> Peer => "/tmp/mysock",
> )
> or die $@;
>
> Right now, I am able to send information from the client to the
> server, but not the other way around. When I try this, I get:send:
>
> Cannot determine peer address at server.pl line 21
>
> Here are lines 17-22:
>
> if($text ne 'exit')
> {
> print "\nReceived message '", $text,"'\n";
> my $send = "I got: $text\n";
> $server->send($send,128); # <------- Line 21
> }
>
> I have tried multiple things with the creation of the socket, but
> cant get the right combination. I am beginning to think that UNIX
> sockets are not bi-directional, but I hope someone proves me wrong.
>
> If more information is needed, let me know.
>
> Thanks for the help,
>
> Dave Kettmann
> NetLogic
> 636-561-0680
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>