mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Adding Documentation
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150129 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
7b387e618f
commit
f257dac2ff
1 changed files with 33 additions and 4 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue