ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Event/Util.pm
(Generate patch)

Comparing Coro/Event/Util.pm (file contents):
Revision 1.3 by root, Mon Sep 24 01:36:21 2001 UTC vs.
Revision 1.4 by root, Thu Nov 21 13:08:06 2002 UTC

28 28
29@EXPORT = qw( 29@EXPORT = qw(
30 gethostbyname gethostbyaddr 30 gethostbyname gethostbyaddr
31); 31);
32 32
33$VERSION = 0.45; 33$VERSION = 0.6;
34 34
35$MAXPARALLEL = 16; # max. number of parallel jobs 35$MAXPARALLEL = 16; # max. number of parallel jobs
36 36
37my $jobs = new Coro::Semaphore $MAXPARALLEL; 37my $jobs = new Coro::Semaphore $MAXPARALLEL;
38 38
60Work exactly like their perl counterparts, but do not block. Currently 60Work exactly like their perl counterparts, but do not block. Currently
61this is being implemented by forking, so it's not exactly low-cost. 61this is being implemented by forking, so it's not exactly low-cost.
62 62
63=cut 63=cut
64 64
65my $netdns = 0 && eval { use Net::DNS 0.24 };
66
65sub gethostbyname($) { 67sub gethostbyname($) {
68 if ($netdns) {
69 die;
70 } else {
66 _do_asy { gethostbyname $_[0] } @_; 71 _do_asy { gethostbyname $_[0] } @_;
72 }
67} 73}
68 74
69sub gethostbyaddr($$) { 75sub gethostbyaddr($$) {
76 if ($netdns) {
77 die;
78 } else {
70 _do_asy { gethostbyaddr $_[0], $_[1] } @_; 79 _do_asy { gethostbyaddr $_[0], $_[1] } @_;
80 }
71} 81}
72 82
731; 831;
74 84
75=head1 AUTHOR 85=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines