logo       

cvs: phpdoc /en/reference/sockets/functions socket-strerror.xml: msg#01103

Subject: cvs: phpdoc /en/reference/sockets/functions socket-strerror.xml
mfischer                Tue Apr 30 18:20:20 2002 EDT

  Modified files:              
    /phpdoc/en/reference/sockets/functions      socket-strerror.xml 
  Log:
  - Update docs.
  
  
Index: phpdoc/en/reference/sockets/functions/socket-strerror.xml
diff -u phpdoc/en/reference/sockets/functions/socket-strerror.xml:1.2 
phpdoc/en/reference/sockets/functions/socket-strerror.xml:1.3
--- phpdoc/en/reference/sockets/functions/socket-strerror.xml:1.2       Wed Apr 
17 02:44:11 2002
+++ phpdoc/en/reference/sockets/functions/socket-strerror.xml   Tue Apr 30 
18:20:19 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/sockets.xml, last change in rev 1.8 -->
   <refentry id="function.socket-strerror">
    <refnamediv>
@@ -12,16 +12,15 @@
       <type>string</type><methodname>socket_strerror</methodname>
       <methodparam><type>int</type><parameter>errno</parameter></methodparam>
      </methodsynopsis>
-       &warn.experimental.func;
+    &warn.experimental.func;
     <para>
      <function>socket_strerror</function> takes as its
-     <parameter>errno</parameter> parameter the return value of one of
-     the socket functions, and returns the corresponding explanatory
-     text. This makes it a bit more pleasant to figure out why
-     something didn't work; for instance, instead of having to track
-     down a system include file to find out what '-111' means, you
-     just pass it to <function>socket_strerror</function>, and it tells you
-     what happened.
+     <parameter>errno</parameter> parameter a socket error code as returned by
+     <function>socket_last_error</function> and returns the corresponding
+     explanatory text. This makes it a bit more pleasant to figure out why
+     something didn't work; for instance, instead of having to track down a
+     system include file to find out what '-111' means, you just pass it to
+     <function>socket_strerror</function>, and it tells you what happened.
     </para>
     <para>
      <example>
@@ -29,12 +28,12 @@
       <programlisting role="php">
 <![CDATA[
 <?php
-if (($socket = socket_create (AF_INET, SOCK_STREAM, 0)) < 0) {
-   echo "socket_create() failed: reason: " . socket_strerror ($socket) . "\n";
+if (false == ($socket = @socket_create(AF_INET, SOCK_STREAM, 0))) {
+   echo "socket_create() failed: reason: " . 
socket_strerror(socket_last_error()) . "\n";
 } 
 
-if (($ret = socket_bind ($socket, '127.0.0.1', 80)) < 0) {
-   echo "socket_bind() failed: reason: " . socket_strerror ($ret) . "\n";
+if (false == (@socket_bind($socket, '127.0.0.1', 80))) {
+   echo "socket_bind() failed: reason: " . 
socket_strerror(socket_last_error($socket)) . "\n";
 }
 ?>
 ]]>





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe