wez             Sun Aug 11 07:14:26 2002 EDT

  Modified files:              
    /phpdoc/en/reference/network/functions      fsockopen.xml 
  Log:
  Document connectionless nature of UDP sockets.
  Fixes Bug #16648.
  
  
Index: phpdoc/en/reference/network/functions/fsockopen.xml
diff -u phpdoc/en/reference/network/functions/fsockopen.xml:1.2 
phpdoc/en/reference/network/functions/fsockopen.xml:1.3
--- phpdoc/en/reference/network/functions/fsockopen.xml:1.2     Wed Apr 17 02:42:03 
2002
+++ phpdoc/en/reference/network/functions/fsockopen.xml Sun Aug 11 07:14:26 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/network.xml, last change in rev 1.2 -->
   <refentry id="function.fsockopen">
    <refnamediv>
@@ -33,6 +33,14 @@
      case.  The optional <parameter>timeout</parameter> can be used to
      set a timeout in seconds for the connect system call.
     </para>
+    <note>
+     <simpara>
+      If you need to set a timeout for reading/writing data over the socket,
+      use <function>socket_set_timeout</function>, as the 
+<parameter>timeout</parameter>
+      parameter to <function>fsockopen</function> only applies while
+      connecting the socket.
+     </simpara>
+    </note>
     <para>
      As of PHP 4.3.0, if you have compiled in OpenSSL support, you may
      prefix the <parameter>hostname</parameter> with either
@@ -107,6 +115,16 @@
 ]]>
      </programlisting>
      </example>
+     <warning>
+      <simpara>
+        UDP sockets will sometimes appear to have opened without an error,
+        even if the remote host is unreachable.  The error will only
+        become apparent when you read or write data to/from the socket.
+        The reason for this is because UDP is a "connectionless" protocol,
+        which means that the operating system does not try to establish
+        a link for the socket until it actually needs to send or receive data.
+      </simpara>
+     </warning>
      <note>
       <para>The timeout parameter was introduced in PHP 3.0.9 and
       UDP support was added in PHP 4.



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to