Jay Jacobs > Audio-Daemon-MPG123-0.9Beta > Audio::Daemon::MPG123::Server

Download:
Audio-Daemon-MPG123-0.9Beta.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.9Beta   Source  

NAME ^

Audio::Daemon::MPG123::Server - The Server portion of Audio::Daemon::MPG123

SYNOPSIS ^

  use Audio::Daemon::MPG123::Server;

  # set things up
  my $daemon = new Audio::Daemon::MPG123::Server(Port => 9101);

  # this should never return... it is a daemon after all.
  $server->mainloop;

DESCRIPTION ^

The Server portion of Audio::Daemon::MPG123, a frontend to a frontend for MPG123. It is kept very seperate to give the user full control over how to daemonize, keep running, monitor it, log messages, maintain access control, etc.

CONSTRUCTORS ^

There is but one method to contruct a new Audio::Daemon::MPG123::Server object:

Audio::Daemon::MPG123::Server->new(Port => $port, [Log => \&logsub], [Allow => <allowips>], [Deny => <denyips>]);

The new method can take the following arguments:

Port

The local port to start listening and accepting commands on.

Log

This takes a reference to a function that's called for logging purposes, the format passed in is:

<type>, <msg>, [caller(1)]

where <type> is one of debug, info, error, crit, warn. <msg> is the text message, and [caller] is the array returned by the second form of the perlfunc caller(). This will give you the method, line number, etc. of where the messagee is coming from. With this logging feature, I don't have to worry about syslog, stdout, or how to report errors or debug info... you do!

Allow, Deny

Access Control. If you specify something for the Allow variable, it assumes everything not allowed will be denied. If you specify something to denied it assumes everything else is allowed. Wither neither set, everything is allowed. It accepts multple formats all seperated by a comma for multiple entries:

<ip>/mask

Either set to full 255.255.255.0 format or bitmask format: /24

<ip>

just an IP specified

<low ip>-<high ip>

For example: 192.168.10.15-192.168.10.44 so anythine between those two addresses would match the rule.

METHODS ^

mainloop

Never returns, and in theory, should never exit.

AUTHOR ^

Jay Jacobs jayj@cpan.org

SEE ALSO ^

Audio::Daemon::MPG123

Audio::Play::MPG123

perl(1).

syntax highlighting: