Eric at Lucii.org on 20 Dec 2010 12:49:57 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Named pipes


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks to all who replied.

Based on the documentation I was expecting a named pipe for IPC but a UNIX
domain socket is just as good or better for my purposes!

I've just installed socat and will give it a try.

Thanks,
Eric

On 12/20/2010 02:14 PM, Julien Vehent wrote:
> On 12/20/2010 12:40 AM, Randall A Sindlinger wrote:
>> On Sun, Dec 19, 2010 at 08:54:55PM -0500, Eric at Lucii.org wrote:
>>> echo "test">  program-named-pipe
>>
>> As a socket, you should be able to see it with netstat.  You should be
>> able to write to it via telnet to the port on localhost, assuming that
>> netstat shows it's listening there and your firewall rules allow it.
> 
> AFAIK, Unix socket won't show in netstat until they are connected (the kernel is
> simply not aware of their existence).
> 
> Also, unix sockets are not network socket. Netcat (or telnet) won't connect to
> it. But socat will. To connect to a unix socket with socat, use 'socat -
> unix:/path/to/socket'.
> (the first argument - tells socat to connect stdin and stdout to the socket...
> yes you can use socat to connect sockets of different types together).
> 
> You can create a unix socket with a few lines of Perl (see attached) and
> experiment.
> 
> 1. Launch the script
> 
>     $ perl socksrv.pl
> 
> 2. try to list the socket using 'netstat --unix |grep /tmp/testsock' (you won't
> see anything)
> 
>     $ netstat --unix|grep /tmp/testsock
>     $
> 
> 3. connect to the socket using socat
> 
>     $ socat -v - unix:/tmp/testsock
> 
> 4. retry the same netstat as before, this time you see the connection
> 
>     $ netstat --unix|grep /tmp/testsock
>     unix  3      [ ]         STREAM     CONNECTED     33091        /tmp/testsock
> 
> 
> 
> Julien
> 
> 
> 
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

- -- 
#  Eric Lucas
#
#                "Oh, I have slipped the surly bond of earth
#                 And danced the skies on laughter-silvered wings...
#                                        -- John Gillespie Magee Jr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0PwWIACgkQ2sGpvXQrZ/5zAgCfbc0t1v6YrNhDzvq1iCYxvr3P
s6IAoKeiDxqYDvesA2b7AURXIs1fAsUN
=ly9y
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug