logo       

cvs: phpdoc /en/reference/sockets/functions socket-create.xml: msg#01106

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

  Modified files:              
    /phpdoc/en/reference/sockets/functions      socket-create.xml 
  Log:
  - Update docs.
  
  
Index: phpdoc/en/reference/sockets/functions/socket-create.xml
diff -u phpdoc/en/reference/sockets/functions/socket-create.xml:1.2 
phpdoc/en/reference/sockets/functions/socket-create.xml:1.3
--- phpdoc/en/reference/sockets/functions/socket-create.xml:1.2 Wed Apr 17 
02:44:07 2002
+++ phpdoc/en/reference/sockets/functions/socket-create.xml     Tue Apr 30 
18:48:37 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.4 -->
   <refentry id="function.socket-create">
    <refnamediv>
@@ -16,13 +16,17 @@
      </methodsynopsis>
      &warn.experimental.func;
     <para>
-     Creates a communication endpoint (a socket), and returns a
-     descriptor to the socket.
+     Creates a communication endpoint (a socket), and returns a socket
+     resource.
     </para>
     <para>
-     The <parameter>domain</parameter> parameter sets the
-     domain. Currently, <constant>AF_INET</constant> and
-     <constant>AF_UNIX</constant> are understood.
+     The <parameter>domain</parameter> parameter sets the domain (protocol
+     family) to be used for communication. Currently,
+     <constant>AF_INET</constant> and <constant>AF_UNIX</constant> are
+     understood. <constant>AF_INET</constant> is typical used for internet
+     based communication. <constant>AF_UNIX</constant> uses pathnames to
+     identify sockets and can therefore only be used for local communication
+     (which is faster, on the other hand).
     </para>
     <para>
      The <parameter>type</parameter> parameter selects the socket
@@ -30,14 +34,20 @@
      <constant>SOCK_DGRAM</constant>,
      <constant>SOCK_SEQPACKET</constant>,
      <constant>SOCK_RAW</constant>, <constant>SOCK_RDM</constant>, or
-     <constant>SOCK_PACKET</constant>.
+     <constant>SOCK_PACKET</constant>. The two most common types are
+     <constant>SOCK_DGRAM</constant> for <literal>UDP</literal>
+     (connectionless) communication
+     and <constant>SOCK_STREAM</constant> for <literal>TCP</literal>
+     communication.
     </para>
     <para>
-     <parameter>protocol</parameter> sets the protocol.
+     <parameter>protocol</parameter> sets the protocol which is either
+     <constant>SOL_UDP</constant> or <constant>SOL_TCP</constant>.
     </para>
     <para>
-     Returns a valid socket descriptor on success, or a negative error
-     code on failure. This code may be passed to
+     Returns a socket resource on success, or &false; on error. The actual
+     error code can be retrieved by calling
+     <function>socket_last_error</function>. This error code may be passed to
      <function>socket_strerror</function> to get a textual explanation of the
      error.
     </para>
@@ -46,12 +56,22 @@
      as well as on the meanings of the various parameters, see the
      Unix man page socket (2).
     </para>
+    <note>
+     <para>
+      If an invalid <parameter>domain</parameter> or
+      <parameter>type</parameter> is given, <function>socket_create</function>
+      defaults to <constant>AF_INET</constant> and
+      <constant>SOCK_STREAM</constant> respectively and additionally emits an
+      <constant>E_WARNING</constant> message.
+     </para>
+    </note>
     <para>
      See also 
      <function>socket_accept</function>,
      <function>socket_bind</function>,
      <function>socket_connect</function>,
-     <function>socket_listen</function>, and
+     <function>socket_listen</function>,
+     <function>socket_last_error</function>, and
      <function>socket_strerror</function>.
     </para>
    </refsect1>





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

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
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