3 Einträge, 1 Seite |
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
use threads; ... sub complete_host #<-Vaterthread { my $installdir = $_[0]; my $threadnr = $_[1]; while($hosts->pending() > 0) { my @temp = split(/;/, $hosts->dequeue_nb()); my $host = Host->new(\@temp); my $thread = threads->new(\&scan_host, $host->get("hostip"), $threadnr); #<-Kindthread, startet nmap $thread->detach(); my $timestamp = time(); my $now = ""; my $remain = ""; do { $now = time(); $remain = $now - $timestamp; if($remain > 60) { print "Subthread in Thread ".$threadnr." wird gekillt!\n"; $thread->exit('STOP'); # $thread->kill(); } } while($thread->is_running()); #werte die XML aus bzw scanne neuen Host }
3 Einträge, 1 Seite |