I have cron which is using fwrite function and after cron is running 1 hour it will crash with error:
fwrite(): send of 29 bytes failed with errno=104 Connection reset by peer
on line:
$fw = @fwrite($this->sock, $msg."
");
After this I always close connection by
fclose($this->sock);
It seems that it is something wrong inside PHP core and DNS resolver because after that I have some problems resolve hostnames to ip adrress. In my functionality is also used getmxrr()
and gethostbyname()
functions.
How to prevent this problems?