PHP: socket_set_nonblock - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

socket_set_option socket_set_block

Last updated: Sat, 27 Jan 2007

view this page in

# 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 )

The socket_set_nonblock() function sets the O_NONBLOCK flag on the socket specified by the `socket` parameter.

Пример 1. socket_set_nonblock() example

`<?php
$port = 9090;
if (($socket = socket_create_listen($port)) === false) {
echo "socket_create_listen() failed. Reason: ".socket_strerror(socket_last_error());
}
if (socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1) === false) {
echo "socket_set_option() failed. Reason: ".socket_strerror(socket_last_error($socket));
}
if (socket_set_nonblock($socket) === false) {
echo "socket_set_nonblock() failed. Reason: ".socket_strerror(socket_last_error($socket));
}
?>`

Возвращает `TRUE` в случае успешного завершения или `FALSE` в случае возникновения ошибки.

See also socket_set_block() and socket_set_option()

add a note User Contributed Notes
socket_set_nonblock
There are no user contributed notes for this page.
socket_set_option socket_set_block

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST