From 60e219c2d8175b8c0f7a0008b2c070a15605c9d7 Mon Sep 17 00:00:00 2001 From: Nuno Lopes <nlopess@php.net> Date: Sat, 31 Jul 2004 14:41:54 +0000 Subject: [PATCH] several fixes for UDP thanks Wez git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@164819 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/stream/constants.xml | 6 ++++-- reference/stream/functions/stream-socket-accept.xml | 8 ++++---- reference/stream/functions/stream-socket-recvfrom.xml | 9 ++++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/reference/stream/constants.xml b/reference/stream/constants.xml index ac50847863..804a3e560e 100644 --- a/reference/stream/constants.xml +++ b/reference/stream/constants.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> +<!-- $Revision: 1.12 $ --> <section id="stream.constants"> &reftitle.constants; &extension.constants; @@ -95,7 +95,9 @@ <entry><constant>STREAM_SERVER_LISTEN</constant> *</entry> <entry>Tells a stream created with <function>stream_socket_server</function> and bound using the <constant>STREAM_SERVER_BIND</constant> flag to start - listening on the socket. TCP Server sockets should always include this flag. + listening on the socket. Connection-orientated transports (such as TCP) + must use this flag, otherwise the server socket will not be enabled. + Using this flag for connect-less transports (such as UDP) is an error. </entry> </row> <row> diff --git a/reference/stream/functions/stream-socket-accept.xml b/reference/stream/functions/stream-socket-accept.xml index 9ca394aaef..d920c55272 100644 --- a/reference/stream/functions/stream-socket-accept.xml +++ b/reference/stream/functions/stream-socket-accept.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.stream-socket-accept"> <refnamediv> <refname>stream_socket_accept</refname> @@ -31,13 +31,13 @@ <simpara> If the call fails, it will return &false;. </simpara> - <note> + <warning> <para> - This function doens't work with UDP server sockets. Use + Using this function with UDP server sockets is an error. You should use <function>stream_socket_recvfrom</function> and <function>stream_socket_sendto</function> instead. </para> - </note> + </warning> <para> See also <function>stream_socket_server</function>, <function>stream_socket_get_name</function>, diff --git a/reference/stream/functions/stream-socket-recvfrom.xml b/reference/stream/functions/stream-socket-recvfrom.xml index 49958ca5a3..08a3ed8363 100644 --- a/reference/stream/functions/stream-socket-recvfrom.xml +++ b/reference/stream/functions/stream-socket-recvfrom.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="function.stream-socket-recvfrom"> <refnamediv> <refname>stream_socket_recvfrom</refname> @@ -73,6 +73,13 @@ fclose($server); ]]> </programlisting> </example> + <note> + <para> + If a message received is longer than the <parameter>length</parameter> + parameter, excess bytes may be discarded depending on the type of socket + the message is received from (such as UDP). + </para> + </note> <para> See also <function>stream_socket_sendto</function>,