socket_set_nonblock

(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)

socket_set_nonblockConfigura o modo nonblocking para o arquivo de descrição fd

Descrição

socket_set_nonblock ( resource $socket ) : bool
Aviso

Esta função é EXPERIMENTAL. O comportamento, seu nome e documentação podem mudar sem aviso em futuras versões do PHP. Utilize por sua própria conta e risco.

Aviso

Esta função não está documentada; somente a lista de argumentos está disponível.

add a note add a note

User Contributed Notes 1 note

up
5
kpobococ at gmail dot com
14 years ago
Beware, when using this function within a loop (i.e. a demon with a socket). The socket_accept(), for example, emits a warning each time there is no incoming connection available to be read. My php error log file got huge in a matter of seconds, eventually crashing the server.

Of course, i used the @ before the function to take care of that problem.

[EDITOR: One can (and should) use socket_select to detect a new connection on a socket (it's a "readable" event)]
To Top