POE::Component::Rendezvous::Publish - publish Rendevouz services from POE


POE-Component-Rendezvous-Publish documentation  | view source Contained in the POE-Component-Rendezvous-Publish distribution.

Index


SYNOPSIS

Top

  use POE qw(Component::Rendezvous::Publish);

  POE::Component::Rendevouz::Publish->create(
      name   => 'My POE-based service',
      type   => '_service._protocol',
      port   => 12345,
      domain => 'local.',
  );




DESCRIPTION

Top

POE::Component::Rendezvous::Publish makes your network-oriented POE-based services available via Rendezvous browsing.

If your POE-based service has a Web interface, you can publish a service via Rendezvous, and all the Rendezvous-enabler browsers will see it.

POE::Component::Rendezvous::Publish uses Net::Rendezvous::Publish to do the actual work. Check it's documentation to see which mDNS systems are supported. As of March 2005, it supported Apple and Howl.

Constructor Parameters

Top

name

A descriptive name for the service.

type

The type of service. This is a string of the form _service._protocol.

port

The port on which you're advertising the service.

domain

The domain in which we advertise a service. Defaults to "local.".

EXAMPLE

Top

A simple HTTP server published via Rendezvous would look like this:

    use POE qw( Component::Rendezvous::Publish Component::Server::HTTP );
    use HTTP::Status;




    my $port = $ENV{HTTP_PORT} || 8787;

    my $http = POE::Component::Server::HTTP->new(
      Port => $port,
      ContentHandler => {
          '/' => \&respond,
      },
      Headers => {
        Server => 'My Rendezvous-aware HTTP server',
      },
    );




    my $publish = POE::Component::Rendezvous::Publish->create(
      name => 'simple http server',
      type => '_http._tcp',
      port => $port,
    );




    $poe_kernel->run;




    sub respond {
      my ($request, $response) = @_;

      $response->code(RC_OK);
      $response->content("Yelllow, you fetched " . $request->uri);

      return RC_OK;
    }




TODO

Top

Support stop publishing a service (given it's name).

Allow publish of several services using the same PoCo::Rendezvous::Publish session.

Right now, we pool each 2 seconds to see if there are network messages pending to be replied. The pooling is limited to 0.01 seconds.

I'm trying to see how we can get a file descriptor from the modules below, so that we can use POE internal Wheels to warn us when there is traffic to be dealt with, thus improving the efficienty of this module.

We don't have any tests either.

SEE ALSO

Top

POE, Net::Rendezvous::Publish, Net::Rendezvous::Publish::Backend::Apple, Net::Rendezvous::Publish::Backend::Howl

ACKNOWLEDGMENTS

Top

Parts of this documentation where stolen^Hcopied from Net::Rendezvous::Publish documentation by Richard Clamp.

AUTHOR

Top

Pedro Melo, <melo@cpan.org<gt>

COPYRIGHT AND LICENSE

Top


POE-Component-Rendezvous-Publish documentation  | view source Contained in the POE-Component-Rendezvous-Publish distribution.