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:
The controller to attach the socket to. If not specified, the socket object won't be created,
new()will just return undef.
The name of the socket, MUST be unique within
eg. '127.0.0.0', '0.0.0.0', 'unix/', '[::1]'.
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 <email@example.com>