there is a bug in php with the win version of socket_set_blocking.
i need a sample code for creating, reading and writing into a socket on a win os in a way that bypasses the blocking method of fgets().
here's mine.. if you've got a better one please help
$fp = fsockopen($host,$port,$errno,$errstr);
if (!$fp)
echo "EROARE: $errno - $errstr<br>\n";
while (!feof($fp))
{
// ce a venit in socket???
$gigi = fgets($fp,4096);
$parsed = explode(" ",$gigi);
if ($parsed[1]=="some event")
fputs($fp,"other event");
if (i want to) fputs($fp,"other event2");
}
the problem is that it stucks in reading from the socket. if there is no data in the socket it will wait for the data to become available. I want to be able to read the socket and if there is or isn't data in it wo write to it without waiting.