Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::bonjour::entry(3pm) [debian man page]

Net::Bonjour::Entry(3pm)				User Contributed Perl Documentation				  Net::Bonjour::Entry(3pm)

NAME
Net::Bonjour::Entry - Support module for mDNS service discovery (Apple's Bonjour) SYNOPSIS
use Net::Bonjour; my $res = Net::Bonjour->new(<service>[, <protocol>]); $res->discover; foreach my $entry ( $res->entries ) { print $entry->name, " "; } DESCRIPTION
Net::Bonjour::Entry is a module used to manage entries returned by a mDNS service discovery (Apple's Bonjour). See Net::Bonjour for more information. METHODS
new([<fqdn>]) Creates a new Net::Bonjour::Entry object. The optional argument defines the fully qualifed domain name (FQDN) of the entry. Normal usage of the Net::Bonjour module will not require the construction of Net::Bonjour::Entry objects, as they are automatically created during the discovery process. address Returns the IP address of the entry. all_attrs Returns all the current attributes in the form of hashed array. attribute(<attribute>) Returns the specified attribute from the TXT record of the entry. TXT records are used to specify additional information, e.g. path for http. dnsrr([<record type>]) Returns an DNS answer packet of the entry. The output will be in the format of a Net::DNS::Packet object. The record type designates the resource record to answer with, i.e. PTR, SRV, or TXT. The default is PTR. fetch Reloads the information for the entry via mDNS. fqdn Returns the fully qualifed domain name (FQDN) of entry. An example FQDN is server._afpovertcp._tcp.local hostname Returns the hostname of the server, e.g. 'server.local'. name Returns the name of the entry. In the case of the fqdn example, the name would be 'server'. This name may not be the hostname of the server. For example, names for presence/tcp will be the name of the user and http/tcp will be title of the web resource. port Returns the TCP or UDP port of the entry. sockaddr Returns the binary socket address for the resource and can be used directly to bind() sockets. EXAMPLES
Print out a list of local websites print "<HTML><TITLE>Local Websites</TITLE>"; use Net::Bonjour; my $res = Net::Bonjour->new('http'); $res->discover; foreach my $entry ( $res->entries) { printf "<A HREF='http://%s%s'>%s</A><BR>", $entry->address, $entry->attribute('path'), $entry->name; } print "</HTML>"; Find a service and connect to it use Net::Bonjour; my $res = Net::Bonjour->new('custom'); $res->discover; my $entry = $res->shift_entry; socket SOCK, PF_INET, SOCK_STREAM, scalar(getprotobyname('tcp')); connect SOCK, $entry->sockaddr; print SOCK "Send a message to the service"; while ($line = <SOCK>) { print $line; } close SOCK; SEE ALSO
Net::Bonjour COPYRIGHT
This library is free software and can be distributed or modified under the same terms as Perl itself. Bonjour (in this context) is a trademark of Apple Computer, Inc. AUTHORS
The Net::Bonjour::Entry module was created by George Chlipala <george@walnutcs.com> perl v5.10.0 2007-03-18 Net::Bonjour::Entry(3pm)

Check Out this Related Man Page

Net::LDAP::Search(3)					User Contributed Perl Documentation				      Net::LDAP::Search(3)

NAME
Net::LDAP::Search - Object returned by Net::LDAP search method SYNOPSIS
use Net::LDAP; $mesg = $ldap->search( @search_args ); @entries = $mesg->entries; DESCRIPTION
A Net::LDAP::Search object is returned from the search method of a Net::LDAP object. It is a container object which holds the results of the search. METHODS
Net::LDAP::Search inherits from Net::LDAP::Message, and so supports all methods defined in Net::LDAP::Message. as_struct ( ) Returns a reference to a HASH, where the keys are the DNs of the results and the values are HASH references. These second level HASHes hold the attributes such that the keys are the attribute names, in lowercase, and the values are references to an ARRAY holding the values. This method will block until the whole search request has finished. count ( ) Returns the number of entries returned by the server. This method will block until the whole search request has finished. entry ( INDEX ) Return the N'th entry (zero-based), which will be a Net::LDAP::Entry object. If INDEX is greater or equal than the total number of entries returned then "undef" will be returned. This method will block until the search request has returned enough entries. entries ( ) Return an array of Net::LDAP::Entry objects that were returned from the server. This method will block until the whole search request has finished. pop_entry ( ) Pop an entry from the internal list of Net::LDAP::Entry objects for this search. If there are no more entries then "undef" is returned. This call will block if the list is empty, until the server returns another entry. references ( ) Return a list of references that the server returned. This will be a list of Net::LDAP::Reference objects. sorted ( ) Return a list Net::LDAP::Entry objects, sorted by their DNs. The sorting is done on the client side using Perl's alphanumerical sort operator "cmp". sorted ( ATTR, ... ) Return a list of Net::LDAP::Entry objects, sorted by the specified attributes. The attributes are compared in the order specified, each only being compared if all the prior attributes compare equal. The sorting is done on the client side using Perl's alphanumerical sort operator "cmp". shift_entry ( ) Shift an entry from the internal list of Net::LDAP::Entry objects for this search. If there are no more entries then "undef" is returned. This call will block if the list is empty, until the server returns another entry. SEE ALSO
Net::LDAP, Net::LDAP::Message, Net::LDAP::Entry, Net::LDAP::Reference ACKNOWLEDGEMENTS
This document is based on a document originally written by Russell Fulton <r.fulton@auckland.ac.nz>. AUTHOR
Graham Barr <gbarr@pobox.com> Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>. COPYRIGHT
Copyright (c) 1997-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-06-07 Net::LDAP::Search(3)
Man Page