Good afternoon
i have the code below to catch dns requst and
save it to a file ip.txt
the problem is that while a dns repuest is being
send (73 bytes eg) only a few are received or saved to
the ip.txt at about 20 to 30 each time
anyome knows what happens?
<?
while(TRUE) {
$socketD = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socketD, "192.168.1.1", 53);
socket_recvfrom($socketD, $buf, 65535, 0, $clientIP, $clientPort);
$File = "ip.txt";
$Handle = fopen($File, 'w');
$Data = $buf;
fwrite($Handle, $Data);
fclose($Handle);
socket_close($socketD);}