Re: IO::Socket::UNIX questions

From: Jonathan Paton (jepaton_at_gmail.com)
Date: 12/31/04

  • Next message: Octavian Rasnita: "Re: Copying a hash-of-hashes"
    Date: Fri, 31 Dec 2004 10:47:50 +0000
    To: "mgoland@optonline.net" <mgoland@optonline.net>, beginners@perl.org
    
    

    On Thu, 30 Dec 2004 22:51:00 -0500, mgoland@optonline.net
    <mgoland@optonline.net> wrote:
    > ...
    > > 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.

    I think "communication through files" is misleading.

    That file is special, it is a named pipe (or named FIFO...). Just like
    /dev/zero and /dev/null, and many of the other files in /dev. The
    pipes always transfer data through memory.

    I would hazard a guess that named pipes and anonymous pipes
    are implemented using the same code. The difference is
    how the connection is established.

    UNIX vs INET is another story. On loopback, I guess INET would
    easily achieve 100MB/sec, and I think UNIX domain sockets
    would be faster still.

    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,,
    

  • Next message: Octavian Rasnita: "Re: Copying a hash-of-hashes"

    Relevant Pages

    • Re: JNI - is it good?
      ... and Java itself knows nothing about the pipe. ... A Unix named pipe is an entry in a Unix file system. ... further before really writing it to the disk, ...
      (comp.lang.java.programmer)
    • Re: {"MSG_f8d8bead972691a4":{},"msgIds":["MSG_f8d8bead972691a4"]}
      ... writing, then how to know when the other side is opened for writing. ... to talk with me about Linux, freedom software, UNIX programming etc. ... when the data is ready on the named pipe for reading. ... You may want to look at Unix Domain Sockets, ...
      (comp.unix.programmer)
    • Re: Named pipe with MF Cobol
      ... there is no problem to work with named pipe in some languages, ... I would like to realize the third user with Cobol. ... certainly read from a FIFO (Unix "named pipe") in Micro Focus COBOL on ...
      (comp.lang.cobol)
    • Re: fork command.
      ... Unix processes use forkto copy their memory space ... Unlike lightweight thread models, Unix processes ... Unix processes can't communicate using ... The nice thing is that you can use IPC to ...
      (comp.lang.perl.misc)
    • Spy on a socket
      ... I have an application with two processes that communicate using a Unix ... Is there a way, similar to tcpdump, to spy on the traffic excahnged on ...
      (freebsd-questions)