ID:               26486
 User updated by:  nunoplopes at sapo dot pt
 Reported By:      nunoplopes at sapo dot pt
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: n/a
 PHP Version:      Irrelevant
 New Comment:

You may apply these patches:

Index: reference.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/sockets/reference.xml,v
retrieving revision 1.11
diff -u -r1.11 reference.xml
--- reference.xml       16 Aug 2003 18:59:12 -0000      1.11
+++ reference.xml       2 Dec 2003 15:05:45 -0000
@@ -190,7 +190,7 @@
 $address = gethostbyname ('www.example.com');

 /* Create a TCP/IP socket. */
-$socket = socket_create (AF_INET, SOCK_STREAM, 0);
+$socket = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);
 if ($socket < 0) {
     echo "socket_create() failed: reason: " . socket_strerror
($socket) . "\n";

 } else {


and:
Index: socket-create.xml
===================================================================
RCS file:
/repository/phpdoc/en/reference/sockets/functions/socket-create.xml,v
retrieving revision 1.6
diff -u -r1.6 socket-create.xml
--- socket-create.xml   22 Jun 2003 19:43:21 -0000      1.6
+++ socket-create.xml   2 Dec 2003 15:10:03 -0000
@@ -142,7 +142,7 @@
        </entry>
       </row>
       <row>
-       <entry>udp</entry>
+       <entry>SOL_UDP</entry>
        <entry>
         The User Datagram Protocol is a connectionless, unreliable,
         protocol with fixed record lengths. Due to these aspects, UDP
@@ -150,7 +150,7 @@
        </entry>
       </row>
         <row>
-       <entry>tcp</entry>
+       <entry>SOL_TCP</entry>
        <entry>
         The Transmission Control Protocol is a reliable, connection
based,
         stream oriented, full duplex protocol. TCP guarantees that all
data packets


---------
I don't know the constant for icmp. maybe its SOL_SOCKET??


Previous Comments:
------------------------------------------------------------------------

[2003-12-01 08:02:34] nunoplopes at sapo dot pt

Description:
------------
In socket_create manual entry and in table 3 (common protocls) you only
say the name of the protocols and you missed the constants.
Instead of tcp, you should write SOL_TCP.

In sockets' main page, you should alter the following line:
$socket = socket_create (AF_INET, SOCK_STREAM, 0);

to

$socket = socket_create (AF_INET, SOCK_STREAM, SOL_TCP);



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26486&edit=1

Reply via email to