← All built-ins / stream_set_blocking()
stream_set_blocking()
stream_set_blocking(...$args): bool
Parameters
| Name | Type | Description |
|---|---|---|
| $sock | resource | socket handle |
| $blocking | bool | true = blocking, false = non-blocking |
Return value
true when the mode was applied.
Example
$srv = stream_socket_server("127.0.0.1:0");
stream_set_blocking($srv, false);
echo "non-blocking set";
stream_close($srv);non-blocking set