ControlFreak::Socket - Defines a (shared) socket controlled by ControlFreak
$sock = ControlFreak::Socket->new( ctrl => $ctrl, name => "fcgisock", host => "unix/", service => "/tmp/cfk-x.sock", options => "TBD", ); $sock->bind; $sock->unbind; $sock->set_host; $sock->set_service; print $sock->service;
Each socket object has a unique name inside ControlFreak controller, services interested in a socket just reference it using this name. The controller pipes the socket to children's stdin after forking, and before executing the service.
Creates a socket objects. Params are:
ctrl
The controller to attach the socket to. If not specified, the socket object won't be created, new() will just return undef.
new()
name
The name of the socket, MUST be unique within ctrl.
host
eg. '127.0.0.0', '0.0.0.0', 'unix/', '[::1]'.
service
eg. '80', '/tmp/cfk.sock'.
If a socket with that name already exists, it will return undef and log the error.
Creates, binds the socket and puts it in listen mode, then returns immediately. Once bound, $socket->fh will return the filehandle.
Returns true if the socket is bound.
Unbind and destroys the socket.
Yann Kerherve <yannk@cpan.org>
To install ControlFreak, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ControlFreak
CPAN shell
perl -MCPAN -e shell install ControlFreak
For more information on module installation, please visit the detailed CPAN module installation guide.