cvs: phpdoc /en/reference/sockets/functions socket-set-block.xml

From: Date: Thu, 29 Jan 2004 20:33:36 +0000
Subject: cvs: phpdoc /en/reference/sockets/functions socket-set-block.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969358566@lists.php.net to get a copy of this message
derek Thu Jan 29 15:33:36 2004 EDT Modified files: /phpdoc/en/reference/sockets/functions socket-set-block.xml Log: Adding Documentation http://cvs.php.net/diff.php/phpdoc/en/reference/sockets/functions/socket-set-block.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc/en/reference/sockets/functions/socket-set-block.xml diff -u phpdoc/en/reference/sockets/functions/socket-set-block.xml:1.1 phpdoc/en/reference/sockets/functions/socket-set-block.xml:1.2 --- phpdoc/en/reference/sockets/functions/socket-set-block.xml:1.1 Thu May 29 15:45:29 2003 +++ phpdoc/en/reference/sockets/functions/socket-set-block.xml Thu Jan 29 15:33:36 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="function.socket-set-block"> <refnamediv> <refname>socket_set_block</refname> @@ -13,9 +13,38 @@ <type>bool</type><methodname>socket_set_block</methodname> <methodparam><type>resource</type><parameter>socket</parameter></methodparam> </methodsynopsis> - - &warn.undocumented.func; - + <para> + The <function>socket_set_block</function> function removes the O_NONBLOCK flag + on the socket specified by the <parameter>socket</parameter> parameter. + </para> + <para> + <example> + <title><function>socket_set_block</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?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)) //Socket $socket is now nonblocking +{ + echo socket_strerror(socket_last_error()); +} +if(!socket_set_block($socket)) //Socket $socket is now blocking +{ + echo socket_strerror(socket_last_error()); +} +?> +]]> + </programlisting> + </example> + </para> <para> &return.success; </para>

« previous php.doc (#969358566) next »