View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Spider Boardman > Net-ext-0.91 > Net::UNIX::Server



Annotate this POD


New  1
Open  1
View/Report Bugs
Module Version: 0.86   Source   Latest Release: Net-ext-1.011


Net::UNIX::Server - UNIX-domain sockets interface module for listeners


    use Socket;                 # optional
    use Net::Gen;               # optional
    use Net::UNIX;              # optional
    use Net::UNIX::Server;


The Net::UNIX::Server module provides additional services for UNIX-domain socket communication. It is layered atop the Net::UNIX and Net::Gen modules, which are part of the same distribution.

Public Methods

The following methods are provided by the Net::UNIX::Server module itself, rather than just being inherited from Net::UNIX or Net::Gen.



    $obj = new Net::UNIX::Server;
    $obj = new Net::UNIX::Server $pathname;
    $obj = new Net::UNIX::Server $pathname, \%parameters;
    $obj = 'Net::UNIX::Server'->new();
    $obj = 'Net::UNIX::Server'->new($pathname);
    $obj = 'Net::UNIX::Server'->new($pathname, \%parameters);

Returns a newly-initialised object of the given class. This is much like the regular new methods of other modules in this distribution, except that it does a bind rather than a connect, and it does a listen. Unless specified otherwise with a type object parameter, the underlying socket will be a datagram socket (SOCK_DGRAM).

The examples above show the indirect object syntax which many prefer, as well as the guaranteed-to-be-safe static method call. There are occasional problems with the indirect object syntax, which tend to be rather obscure when encountered. See <URL:> for details.

See Net::TCP::Server for an example of running a server. The differences are only in the module names and the fact that UNIX-domain sockets bind to a pathname rather than to a port number. Of course, that example is for stream (type = SOCK_STREAM) sockets rather than for datagrams. UNIX-domain datagram sockets don't need to do an accept() (and can't where I've tested this code), and can't answer back to their clients unless those clients have also bound to a specific path name.



    return undef unless $self = $self->init;
    return undef unless $self = $self->init(\%parameters);
    return undef unless $self = $self->init($pathname);
    return undef unless $self = $self->init($pathname, \%parameters);

Verifies that all previous parameter assignments are valid (via checkparams). Returns the incoming object on success, and undef on failure. Usually called only via a derived class's init method or its own new call.

Protected Methods

[See the description in "Protected Methods" in Net::Gen for my definition of protected methods in Perl.]


Known Socket Options

There are no socket options known to the Net::UNIX::Server module itself.

Known Object Parameters

There are no object parameters registered by the Net::UNIX::Server module itself.







The following :tags are available for grouping exportable items:


All of the above exportable items.


Spider Boardman <spider@Orb.Nashua.NH.US>

syntax highlighting: