nicobn Sat Jul 21 17:55:08 2007 UTC
Modified files:
/phpdoc/en/reference/sockets/functions socket-sendto.xml
Log:
- Removed MSG_EOR and MSG_EOF for the moment, as they are not registered
- Corrected the example (closed bug #36109)
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/sockets/functions/socket-sendto.xml?r1=1.9&r2=1.10&diff_format=u
Index: phpdoc/en/reference/sockets/functions/socket-sendto.xml
diff -u phpdoc/en/reference/sockets/functions/socket-sendto.xml:1.9
phpdoc/en/reference/sockets/functions/socket-sendto.xml:1.10
--- phpdoc/en/reference/sockets/functions/socket-sendto.xml:1.9 Tue Jul 3
00:48:19 2007
+++ phpdoc/en/reference/sockets/functions/socket-sendto.xml Sat Jul 21
17:55:08 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.socket-sendto">
<refnamediv>
<refname>socket_sendto</refname>
@@ -82,18 +82,6 @@
Bypass routing, use direct interface.
</entry>
</row>
- <row>
- <entry><constant>MSG_EOR</constant></entry>
- <entry>
- Data completes record.
- </entry>
- </row>
- <row>
- <entry><constant>MSG_EOF</constant></entry>
- <entry>
- Data completes transaction.
- </entry>
- </row>
</tbody>
</tgroup>
</table>
@@ -138,16 +126,13 @@
<programlisting role="php">
<![CDATA[
<?php
- $sh = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
- if (socket_bind($sh, '127.0.0.1', 4242)) {
- echo "Socket bound correctly";
- }
- $buf = 'Test Message';
- $len = strlen($buf);
- if (socket_sendto($sh, $buf, $len, 0x100, '192.168.0.2', 4242) !== false) {
- echo "Message sent correctly";
- }
- socket_close($sh);
+ $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+
+ $msg = "Ping !";
+ $len = strlen($msg);
+
+ socket_sendto($sock, $msg, $len, 0, '127.0.0.1', 1223);
+ socket_close($sock);
?>
]]>
</programlisting>