socket_sendto docs

From: Date: Wed, 28 May 2003 21:48:12 +0000
Subject: socket_sendto docs
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969354002@lists.php.net to get a copy of this message
Heres the diff, added an example so its a bit more complex, hope its OK: Index: socket-sendto.xml =================================================================== RCS file: /repository/phpdoc/en/reference/sockets/functions/socket-sendto.xml,v retrieving revision 1.2 diff -u -r1.2 socket-sendto.xml --- socket-sendto.xml 17 Apr 2002 06:44:10 -0000 1.2 +++ socket-sendto.xml 28 May 2003 21:47:00 -0000 @@ -19,7 +19,76 @@
      </methodsynopsis>
      &warn.experimental.func;
     <para>
-     &warn.undocumented.func;
+     The function <function>socket_sendto</function> sends
+     <parameter>len</parameter> bytes from <parameter>buf</parameter>
+     through the socket <parameter>socket</parameter> to the
+     <parameter>port</parameter> at the address <parameter>addr</parameter>
+    </para>
+    <para>
+     The value of <parameter>flags</parameter> can be one of the
+     following:
+     <table>
+      <title>possible values for <parameter>flags</parameter></title>
+      <tgroup cols="2">
+       <tbody>
+        <row>
+         <entry><literal>0x1</literal></entry>
+         <entry>
+          process out-of-band data
+         </entry>
+        </row>
+        <row>
+         <entry><literal>0x2</literal></entry>
+         <entry>
+          peek at incoming message
+         </entry>
+        </row>
+        <row>
+         <entry><literal>0x4</literal></entry>
+         <entry>
+          bypass routing, use direct interface
+         </entry>
+        </row>
+        <row>
+         <entry><literal>0x8</literal></entry>
+         <entry>
+          data completes record
+         </entry>
+        </row>
+        <row>
+         <entry><literal>0x100</literal></entry>
+         <entry>
+          data completes transaction
+         </entry>
+        </row>
+       </tbody>
+      </tgroup>
+     </table>
+    </para>
+    <example>
+     <title><function>socket_sendto</function> Example</title>
+     <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;
+?> +]]>
+     </programlisting>
+    </example>
+    <para>
+     See also
+     <function>socket_send</function> and
+     <function>socket_sendmsg</function>.
+    </para>
     </para>
    </refsect1>
</refentry> - Davey

« previous php.doc (#969354002) next »