Here's my code:
while(($buf = socket_read($socket,1,PHP_BINARY_READ)) !== false) { $data .= $buf; if(preg_match("/TERMINATING/",$data)) { $msg_recv = 1; break; } }
The PHP docs on socket_read suggest how this might be done:
"Note: socket_read() may return a zero length string ("") indicating the end of communication (i.e. the remote end point has closed the connection)."
Does this "end of communication" include cases when the socket server dies without gracefully disconnecting? How could my code check for this zero length string? Any help is much appreciated. Thanks!
...René
--- René Fournier www.renefournier.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php