On Mon, 23 Feb 2004 14:58:01 +0000, Fred H wrote:
I'm communicating with a server using UDP, and it can be narrowed down to
this:
$us = 75000; //Timeout in microseconds. $con =
fsockopen("udp://127.0.0.0","23000"); stream_set_timeout($con,0,$us);
fwrite($con"\xff\info\");
$retval = fgets($con,10240);
I don't see any reason to use stream_set_timeout() with UDP since UDP is
connectionless. Sometimes, fsockopen() won't even tell you that something
went wrong; you'll find this out reading/writing to the resource.
I say try working with it without the timeout. Look for errors using
fwrite()/fgets() and then take the appropriate decisions.
--
Daniel