Hi all,
          I am facing some problem in socket_recvfrom() in php.

I am creating a udp socket and sending request to the server(is basically a
c program).
I am unable to recive the response from  server.I am using UNIX domain
sockets.
sample of code,what I am using.

<?php
    $PHPDG_PATH ="/var/ph.unixdg";
    $PHPDG_TMP = "/var/php.xxxxxx";
    $service_port = 0;
    $socket = socket_create (AF_UNIX, SOCK_DGRAM, 0);
    if ($socket == FALSE)
    {
       echo "socket_create() failed: reason: " . socket_strerror
(socket_last_error()) . "\n";
    }
    $bnd =  socket_bind ( $socket, $PHPDG_TMP,$service_port);
    $len = strlen($str);
    $retval = socket_sendto ($socket, $str, $len, 0, $PHPDG_PATH,
$service_port);
    if ($retval == FALSE)
    {
       echo "\nsocket_sendto() failed.\nReason: " . socket_strerror
(socket_last_error()) . "\n";
    }
    $succ = socket_recvfrom ($socket, &$buff,50000,0,
$address1,$service_port1); // here i am waiting for response from server,but
i am unable to get response .What might be the problem.
    socket_close ($socket);
    unlink("/var/php.xxxxxx");
?>

Server side.
In the server after receiving the message.I am giving the response to client
using sendto() method.

Can some one help me how to over come the problem over here.

regards
Amarnath R

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to