Leser: 1
|< 1 2 >| | 11 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use threads;
use IO::Socket;
open(IPS, "$ARGV[0]");
my @target = <IPS>;
close(IPS);
my $process_this_many = @target;
my $max_threads = "20";
my $worker = 0;
while ($worker <= $process_this_many) {
for (my $x = 1; $x <= $max_threads && $worker <= $process_this_many; $x++) {
$thr = threads->new(\&sub1, "$target[$x]");
#print "Start $x $worker\n";
$worker++;
}
# Loop through all the threads
foreach $thr (threads->list) {
# Don't join the main thread or ourselves
if ($thr->tid && !threads::equal($thr, threads->self)) {
$data = $thr->detach;
#print "$data\n";
}
}
}
sub sub1 {
my $t = shift;
$con = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$t", PeerPort => "3306" , Timeout => 5) || die "\n+ Connection failed...\n";
while($ams = <$con>) { print $_ }
shutdown($con,2);
}
foilo+2007-08-04 10:36:28--Nein ich benutze beides nicht, das gepostet script ist komplet und es fehlt nischts
|< 1 2 >| | 11 Einträge, 2 Seiten |