php sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php

/* Get the port for the WWW service. */
//$service_port = getservbyname('www', 'tcp');

/* Get the IP address for the target host. */
//$address = gethostbyname('www.example.com');

/* Create a TCP/IP socket. */
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
//echo "Attempting to connect to '$address' on port '$service_port'...";
$result = socket_connect($socket, "127.0.0.1", "27015");

socket_RECV($socket, $read, 300, null);
   echo $read;
socket_close($socket);
?>

i have a daemon running on that port that sends a message when it's  got a 
client connected
but the script above doesn't output anything it just loads my cpu up to 100 
percent and thats it then it basically stops working. While i need it to 
display the messages sent by server(daemon) to the user running the script 
has anyone got any idea why it rejects to work? (yeah the daemon is written 
in c++ if that matters) 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux