nicobn Thu Aug 16 19:36:34 2007 UTC
Modified files:
/phpdoc/en/reference/sockets/functions socket-set-option.xml
Log:
Added an example and parameter description
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sockets/functions/socket-set-option.xml?r1=1.11&r2=1.12&diff_format=u
Index: phpdoc/en/reference/sockets/functions/socket-set-option.xml
diff -u phpdoc/en/reference/sockets/functions/socket-set-option.xml:1.11
phpdoc/en/reference/sockets/functions/socket-set-option.xml:1.12
--- phpdoc/en/reference/sockets/functions/socket-set-option.xml:1.11 Wed Jun
20 22:25:25 2007
+++ phpdoc/en/reference/sockets/functions/socket-set-option.xml Thu Aug 16
19:36:34 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.socket-set-option">
<refnamediv>
<refname>socket_set_option</refname>
@@ -32,6 +32,8 @@
<term><parameter>socket</parameter></term>
<listitem>
<para>
+ A valid socket resource created with <function>socket_create</function>
+ or <function>socket_accept</function>.
</para>
</listitem>
</varlistentry>
@@ -77,6 +79,27 @@
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>socket_set_option</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$socket = socket_create_listen(1223);
+socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1);
+
+if (socket_get_option($socket, SOL_SOCKET, SO_REUSEADDR) !== 0) {
+ echo 'SO_REUSEADDR is set on socket !' . PHP_EOL;
+}
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
<refsect1 role="changelog">
&reftitle.changelog;
<para>