stream_set_blocking 1

stream_set_blocking

#Used to set blocking/non-blocking mode on a stream

stream_set_blocking ( resource $stream , bool $enable )

#Returns a bool value.

Here is what the above code is Doing:
1. We’re creating a stream context using stream_context_create()
2. We’re setting the options for the stream context using stream_context_set_option()
3. We’re setting the timeout for the stream context using stream_context_set_option()
4. We’re creating a stream using stream_socket_client()
5. We’re setting the timeout for the stream using stream_set_timeout()
6. We’re setting the blocking mode for the stream using stream_set_blocking()

Similar Posts