in reply to Re: Perl threads to open 200 http connections
in thread Perl threads to open 200 http connections
Hi Alex, after the 63 connections forking stops and following is the error. -- Cant Fork: Resource temporarily unavailable.
Below is the code -for (my $i=0;$i<200;$i++) { my $filename = "File-10M-".$i.".txt"; FORK: { if ($pid=fork) { next; } elsif (defined $pid) { # system("wget --output-document D:\\kshare\\payload\\$filena +me http://10.2.1.23/http-path/payload/10MB/$filename >nul"); print "$filename\n"; exit; } elsif ($! eq "EAGAIN"){ redo FORK; } else { print "Cant Fork: $!"; exit 2; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Perl threads to open 200 http connections
by BrowserUk (Patriarch) on Aug 03, 2010 at 11:31 UTC |