Hi
I'm using the fputs function to send data over a socket connection (non-blocking). I'm using a loop to send the data I need (8 words). So it looks something like this :
for ($loop=0; $loop<8; $loop++)
{
fputs ($fp, "This is text number ".($loop+1)."...\n");
//sleep (1);
}
When I leave the sleep function out however, the script doesn't send the messages properly. I really don't want this loop to take 8 seconds to complete every time it's executed, but using the sleep function seems the only way to make it work. I can't use the usleep function either, since I'm running Apache under WIN32 (with the PHP module installed), and usleep doesn't work under WIN32.
Can someone tell me where the problem is here and what I can do to run the loop correctly without losing a lot of time?
Thanks a lot!
Tim