POE::Component::Rendezvous::Publish - publish Rendevouz services from POE
use POE qw(Component::Rendezvous::Publish); POE::Component::Rendevouz::Publish->create( name => 'My POE-based service', type => '_service._protocol', port => 12345, domain => 'local.', );
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.
A descriptive name for the service.
The type of service. This is a string of the form _service._protocol.
The port on which you're advertising the service.
The domain in which we advertise a service. Defaults to "local.".
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; }
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.
POE, Net::Rendezvous::Publish, Net::Rendezvous::Publish::Backend::Apple, Net::Rendezvous::Publish::Backend::Howl
Parts of this documentation where stolen^Hcopied from Net::Rendezvous::Publish documentation by Richard Clamp.
Pedro Melo, <melo@cpan.org<gt>
Copyright 2005 by Pedro Melo
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install POE::Component::Rendezvous::Publish, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Rendezvous::Publish
CPAN shell
perl -MCPAN -e shell install POE::Component::Rendezvous::Publish
For more information on module installation, please visit the detailed CPAN module installation guide.