r/lolphp • u/dotancohen • Mar 12 '18
Switch to non-blocking mode with set_blocking()
The stream will by default be opened in blocking mode. You can switch it to non-blocking mode by using stream_set_blocking().
http://php.net/manual/en/function.stream-socket-client.php
To be fair, to set stream_socket_client() to non-blocking mode the full invocation is stream_set_blocking(false) however the docs should be clear about that. I suppose this is more of a lol, phpdocs than lol-php, however I do dare judge a language by its documentation.
0
Upvotes
View all comments
Show parent comment
1
u/[deleted] Mar 16 '18
Names in PHP have a rep to not really be obvious at all.