socket_set_nonblock
(PHP 4 >= 4.1.0, PHP 5)
socket_set_nonblock -- Sets nonblocking mode for file descriptor fd
Description
bool
socket_set_nonblock ( resource socket)
Atenção |
Esta função é
EXPERIMENTAL. Isso quer dizer que o comportamento desta função
e seu nome, incluindo TUDO o que está documentado aqui
pode mudar em futuras versões do PHP, SEM QUALQUER NOTIFICAÇÃO.
Esteja avisado, e use esta função por sua própria conta e risco. |
The socket_set_nonblock() function sets the O_NONBLOCK flag
on the socket specified by the socket parameter.
Exemplo 1. socket_set_nonblock() example
<?php $port = 9090; if (!$socket = socket_create_listen($port)) { echo socket_strerror(socket_last_error()); }
if (!socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) { echo socket_strerror(socket_last_error()); }
if (!socket_set_nonblock($socket)) { echo socket_strerror(socket_last_error()); } ?>
|
|
Retorna TRUE em caso de sucesso ou FALSE em falhas.
See also socket_set_block() and
socket_set_option()