Net::Peep::BC


NAME

Net::Peep::BC - Perl extension for Peep: The Network Auralizer


SYNOPSIS

  use Net::Peep::BC;
  my $bc = new Net::Peep::BC;
  $bc->send($notice,$server);


DESCRIPTION

Net::Peep::BC is a broadcast library for Peep: The Network Auralizer. It contains methods that allow Peep clients to communicate events and other information to the Peep server.

EXPORT

None by default.

CONSTANTS

See the ``Server Data Structures'' of the Peep server documentation for more information regarding the usage of the constants.

  PROT_MAJOR_VER
  PROT_MINOR_VER
  PROT_BC_SERVER
  PROT_BC_CLIENT
  PROT_SERVER_STILL_ALIVE
  PROT_CLIENT_STILL_ALIVE
  PROT_CLIENT_EVENT
  PROT_CLASS_DELIM
  INTERVAL - The amount of time (in seconds) between when the alarm
  handler (see the handlealarm method) is set and the SIGALRM signal
  is sent.
  BC_INTERVAL - The number of intervals between sending broadcasts.
  A broadcast packet is sent when a client is first initialized
  and then only when no servers have been detected

CLASS ATTRIBUTES

  %Leases - Deprecated
  %Servers - A hash the keys of which are the servers found by
  autodiscovery methods (i.e., methods in which clients and servers
  notify each other of their existence) and the values of which are
  anonymous hashes containing information about the server, including
  an expiration time after which if the client has not heard from the
  server, the server is deleted from the %Servers hash.
  %Defaults - Default values for options such as 'priority', 'volume',
  'dither', 'sound'.

PUBLIC METHODS

Note that this section is somewhat incomplete. More documentation will come soon.

    new($conf) - Net::Peep::BC constructor.  $conf is a
    Net::Peep::Conf object.  If an option is not specified in the
    configuration object, the equivalent value in the %Defaults class
    attributes is used.
    send($notice) - Sends a packet including information on
    sound, location, priority, volume etc. to each server specified in
    the %Servers hash.
    assemble_bc_packet() - Assembles the broadcast packet.  Duh.
    logger() - Returns a Net::Peep::Log object used for log messages and
    debugging output.
    sendout($notice,$server) - Used by send() to send the $notice
    packet to the server $server.
    handlealarm() - Refreshes and purges the server list.  Schedules
    the next SIGALRM signal to be issued in another INTERVAL
    seconds.
    updateserverlist() - Polls to see if any of the servers have sent
    alive broadcasts so that the server list can be updated.
    purgeserverlist() - Removes servers from the server list if they
    have not sent an alive broadcast within their given expiration
    time.
    addnewserver($server,$packet) - Adds the server $server based on
    information provided in the packet $packet.  The server is only
    added if it does not exist in the %Servers hash.  The server is
    pysically added by a call to the addserver method.
    addserver($server,$leasemin,$leasesec) - Adds the server $server.
    The server is expired $leasemin minutes and $leasesec seconds
    after being added if it has not sent an alive message in the
    meantime.  Sends the server a client BC packet.
    updateserver($server,$packet) - Updates the expiration time for
    server $server.  Sends the server a client still alive message.

PRIVATE METHODS

    initialize(%options) - Net::Peep::BC initializer.  Called from the
    constructor.  Performs the following actions:
      o Sets instance attributes via the %options argument
      o Loads configuration information from configuration file
        information passed in through the %options argument
      o Opens a socket and broadcasts an 'alive' message
      o Starts up the alarm.  Every INTERVAL seconds, the 
        alarm handler updates the server list.


AUTHOR

Michael Gilfix <mgilfix@eecs.tufts.edu> Copyright (C) 2000

Collin Starkweather <collin.starkweather@colorado.edu> Copyright (C) 2000


SEE ALSO

perl(1), peepd(1), Net::Peep::Dumb, Net::Peep::Log, Net::Peep::Parser, Net::Peep::Log.

http://peep.sourceforge.net


TERMS AND CONDITIONS

You should have received a file COPYING containing license terms along with this program; if not, write to Michael Gilfix (mgilfix@eecs.tufts.edu) for a copy.

This version of Peep is open source; you can redistribute it and/or modify it under the terms listed in the file COPYING.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 Net::Peep::BC