PHP halts after calling non-existing socket
| From: | Artzi, Yoav \(Yoav\) | Date: | Thu, 25 May 2006 14:07:09 +0000 |
| Subject: | PHP halts after calling non-existing socket | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-236889@lists.php.net to get a copy of this message | ||
After calling a non existing socket PHP halts and doesn't return. It
happens when we do it through our web server (AppWeb) or through the
command line. The problem is with socket_recvfrom. (see code below)
Is this a known bug? a mistake I make in accessing sockets? installation
error on my side?
Thanks.
Code:
<?php
unlink ("/tmp/local_domain");
$addr = "/tmp/main_adaptor_sock";
$socket = socket_create(AF_UNIX, SOCK_DGRAM, 0);
if (!$socket)
echo "problem in creating socket";
if (!socket_bind($socket, "/tmp/local_domain"))
echo "problem in binding socket";
$buffer = "Update";
socket_sendto($socket, $buffer, strlen($buffer), 0, $addr);
socket_recvfrom($socket, $buffer, 100, 0, $from);
echo "message recv $buffer \n";
?>