Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::dns::async(3pm) [debian man page]

Net::DNS::Async(3pm)					User Contributed Perl Documentation				      Net::DNS::Async(3pm)

NAME
Net::DNS::Async - Asynchronous DNS helper for high volume applications SYNOPSIS
use Net::DNS::Async; my $c = new Net::DNS::Async(QueueSize => 20, Retries => 3); for (...) { $c->add(&callback, @query); } $c->await(); sub callback { my $response = shift; ... } DESCRIPTION
Net::DNS::Async is a fire-and-forget asynchronous DNS helper. That is, the user application adds DNS questions to the helper, and the callback will be called at some point in the future without further intervention from the user application. The application need not handle selects, timeouts, waiting for a response or any other such issues. If the same query is added to the queue more than once, the module may combine the queries; that is, it will perform the query only once, and will call each callback registered for that query in turn, passing the same Net::DNS::Response object to each query. For this reason, you should not modify the Net::DNS::Response object in any way lest you break things horribly for a subsequent callback. This module is similar in principle to POE::Component::Client::DNS, but does not require POE. CONSTRUCTOR
The class method new(...) constructs a new helper object. All arguments are optional. The following parameters are recognised as arguments to new(): QueueSize The size of the query queue. If this is exceeded, further calls to add() will block until some responses are received or time out. Retries The number of times to retry a query before giving up. Timeout The timeout for an individual query. METHODS
$c->add($callback, @query) Adds a new query for asynchronous handling. The @query arguments are those to Net::DNS::Resolver->bgsend(), q.v. This call will block if the queue is full. When some pending responses are received or timeout events occur, the call will unblock. The user callback will be called at some point in the future, with a Net::DNS::Packet object representing the response. If the query timed out after the specified number of retries, the callback will be called with undef. $c->await() Flushes the queue, that is, waits for and handles all remaining responses. BUGS
The test suite does not test query timeouts. SEE ALSO
Net::DNS, POE::Component::Client::DNS COPYRIGHT
Copyright (c) 2005-2006 Shevek. 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.10.0 2008-10-03 Net::DNS::Async(3pm)

Check Out this Related Man Page

Mail::DKIM::DNS(3)					User Contributed Perl Documentation					Mail::DKIM::DNS(3)

NAME
Mail::DKIM::DNS - performs DNS queries for Mail::DKIM DESCRIPTION
This is the module that performs DNS queries for Mail::DKIM. CONFIGURATION
This module has a couple configuration settings that the caller may want to use to customize the behavior of this module. $Mail::DKIM::DNS::TIMEOUT This global variable specifies the maximum amount of time (in seconds) to wait for a single DNS query to complete. The default is 10. Mail::DKIM::DNS::resolver() Use this global subroutine to get or replace the instance of Net::DNS::Resolver that Mail::DKIM uses. If set to undef (the default), then a brand new default instance of Net::DNS::Resolver will be created the first time a DNS query is needed. You will call this subroutine if you want to specify non-default options to Net::DNS::Resolver, such as different timeouts, or to enable use of a persistent socket. For example: # first, construct a custom DNS resolver my $res = Net::DNS::Resolver->new( udp_timeout => 3, tcp_timeout => 3, retry => 2, ); $res->udppacketsize(1240); $res->persistent_udp(1); # then, tell Mail::DKIM to use this resolver Mail::DKIM::DNS::resolver($res); Mail::DKIM::DNS::enable_EDNS0() This is a convenience subroutine that will construct an appropriate DNS resolver that uses EDNS0 (Extension mechanisms for DNS) to support large DNS replies, and configure Mail::DKIM to use it. (As such, it should NOT be used in conjunction with the resolver() subroutine described above.) Mail::DKIM::DNS::enable_EDNS0(); Use of EDNS0 is recommended, since it reduces the need for falling back to TCP when dealing with large DNS packets. However, it is not enabled by default because some Internet firewalls which do deep inspection of packets are not able to process EDNS0-enabled packets. When there is a firewall on a path to a DNS resolver, the EDNS0 feature should be specifically tested before enabling. AUTHOR
Jason Long, <jlong@messiah.edu> COPYRIGHT AND LICENSE
Copyright (C) 2006-2007, 2012-2013 by Messiah College This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available. perl v5.18.2 2013-02-07 Mail::DKIM::DNS(3)
Man Page