NAME
NetworkInfo::Discovery::Rendezvous - NetworkInfo::Discovery extension to find Rendezvous services
VERSION
Version 0.06
SYNOPSIS
use NetworkInfo::Discovery::Rendezvous;
my $scanner = new NetworkInfo::Discovery::Rendezvous domain => 'example.net';
$scanner->do_it;
# print the list of services sorted by host
for my $host ($scanner->get_interfaces) {
printf "%s (%s)\n", $host->{nodename}, $host->{ip};
for my $service (@{$host->{services}}) {
printf " %s (%s:%d)\n", $service->{name}, $service->{protocol}, $service->{port}
}
}
# print the list of services by service name
for my $service (sort {$a->{name} cmp $b->{name}} $scanner->get_services) {
printf "--- %s ---\n", $service->{name};
for my $host (sort @{$service->{hosts}}) {
printf " %s (%s:%s:%d)\n %s\n", $host->{nodename}, $host->{ip},
$host->{services}[0]{protocol}, $host->{services}[0]{port}
}
}
See also eg/rvdisc.pl for a more complete example.
DESCRIPTION
This module is an extension to NetworkInfo::Discovery
which can find services that register themselves using DNS-SD (DNS Service Discovery), the services discovery protocol behind Apple Rendezvous.
It will first try to enumerate all the registered services by querying the dns-sd
pseudo-service, which is available since the latest versions of mDNSResponder. If nothing is returned, it will then query some well-known services like afpovertcp
.
METHODS
- new()
-
Creates and returns a new
NetworkInfo::Discovery::Rendezvous
object, which derives fromNetworkInfo::Discovery::Detect
.Options
domain
- expects a scalar or an arrayref of domains
Example
# specify one domain my $scanner = new NetworkInfo::Discovery::Rendezvous domain => 'example.net'; # specify several domains my $scanner = new NetworkInfo::Discovery::Rendezvous domain => [ qw(local example.net) ];
- do_it()
-
Run the services discovery.
- get_services()
-
Returns the list of discovered services.
- discover_service()
-
Discover instances of a given service.
- domain()
-
Add domains to the search list.
Examples
$scanner->domain('zeroconf.org'); $scanner->domain(qw(local zeroconf.org example.com));
SEE ALSO
NetworkInfo::Discovery, Net::Rendezvous
AUTHOR
Sébastien Aperghis-Tramoni, <sebastien@aperghis.net>
BUGS
Please report any bugs or feature requests to bug-networkinfo-discovery-rendezvous@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/Bugs.html?Dist=NetworkInfo-Discovery-Rendezvous. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
COPYRIGHT & LICENSE
Copyright 2004-2006 Sébastien Aperghis-Tramoni, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.