9 my @dom = ("seed","bitcoin","sipa","be");
18 my $sock = IO::Socket::INET->new(
21 PeerAddr => "vps.sipa.be",
22 ) or die "Could not create socket: $!\n";
26 my $id = int(rand(65536));
39 my $header = pack('nnnnnn',$id,1*$qr + 2*$opcode + 32*$aa + 64*$tc + 128*$rd + 256*$ra + 512*$z + 4096*$rcode, $qdcount, $ancount, $nscount, $arcount);
40 my $qtype = 1; # A record
41 my $qclass = 1; # IN class
42 my $query = (join("", map { chr(length($_)) . $_ } (@dom,""))) . pack('nn',$qtype,$qclass);
43 my $msg = $header . $query;
46 $runs++ if ($sock->recv($resp, 512, 0));
56 $threads[$i] = threads->create(\&go, $i);
63 foreach my $thr (@threads) {
64 $runs += $thr->join();