Ich behaupte der Apache stürzt nicht ab, er hängt nur ewig an dem Scirpt fest. Hierzu mal in der Konfiguration von php nach
max_execution_time schauen.
Das Problem ist, dass er bei udp-Verbindungen nicht feststellt wenn keine Verbindung aufgebaut wurde.
Man könnte also zum Test erst eine tcp-Verbindung aufbauen und wenn die klappte, die udp-Verbindung.
Ich hab das mal (schnell und schmutzig) in das von dir genannte Script ein gebaut.
|
PHP Source code
|
1
2
3
4
5
6
7
8
|
// Verbindung zum Server aufbauen
function connect() {
$this->fp = fsockopen("tcp://".$this->ip, $this->port, $errno, $errstr, 3);
if (!$this->fp) {
die("offline");
}
$this->fp = fsockopen("udp://".$this->ip, $this->port, $errno, $errstr, 3);
}
|