IO::Socket::UNIX Reference
The IO::Socket::UNIX subclass creates a Unix-domain
socket. Unix-domain sockets are local to the current host and are
used internally to implement pipes, thus providing communication
between unrelated processes. Using sockets provides finer control
than using named pipes, also called FIFO (first-in, first-out)
buffers. This is because receiving sockets can distinguish between
different client connections, which can then be assigned to
different sessions with the accept call.
The IO::Socket::UNIX constructor (new( )) creates the socket and returns an
object containing a filehandle. The constructor can take the
following options:
Type => SOCK_STREAM | SOCK_DGRAMIndicates the type of socket:
SOCK_STREAMfor streaming,SOCK_DGRAMfor packets or datagrams.Local =>pathnameProvides the pathname of the FIFO buffer to bind to the socket.
Peer =>pathnameProvides the pathname to the destination FIFO buffer.
Listen =>nCreates a listen socket and sets the queue size to
n.
The following methods can be used on an object created with IO::Socket::UNIX.