Question

So today I did this $fp = fsockopen($host, 80, $errno, $errstr, 50);. The stream should remain live for 50 seconds. I'm debugging using xdebug to step into each line of code and currently I'm one line passed my fsockopen line.

Does the socket still remain open for 50 real time seconds even though I'm in debug mode or does it wait until I finish debugging to count down?

Was it helpful?

Solution

The timeout only affects how long fsockopen() will wait for a connection. Once the connection has been established, there is a different timeout value used for reads/writes.

See the stream_set_timeout() documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top