Code Comments
Programming Forum and web based access to our favorite programming groups.> Hey Nuno, > > A couple of comments: > > The LISTEN flag is used to actually "switch-on" a > connection-orientated transport (eg: TCP) so that it can accept > connections. > > So that sentence should read something like: > > "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." OK, I'll change that. > PHP 5.1 will include a new function "stream_socket_listen" that will > allow you manually listen(). The rationale for that is that you might > want to alter some socket settings before actually accepting > connections. Currently, there aren't any of these to configure, so it > is low priority. Was this already added? > Rather than saying "this function doesn't work with UDP sockets", you > should say "it is an error to use this function with UDP sockets", > because the function itself isn't broken or deficient; using it with > UDP sockets is an error in your code. I'll change this too. And maybe turn <note> into <warning>. > The UDP example reads only a single byte; check the specs for the > daytime protocol to see how much it should read; if it isn't reading > enough, that script might break. Quote (http://www.faqs.org/rfcs/rfc867.html): "UDP Based Daytime Service Another daytime service service is defined as a datagram based application on UDP. A server listens for UDP datagrams on UDP port 13. When a datagram is received, an answering datagram is sent containing the current date and time as a ASCII character string (the data in the received datagram is ignored)." Uhm, I think 1 byte is enough? Thanks for your comments! Nuno > On Sat, 31 Jul 2004 11:48:38 -0000, Nuno Lopes <nlopess@php.net> wrote: http://cvs.php.net/diff.php/phpdoc/...10&r2=1.11&ty=u[c olor=darkred] phpdoc/en/reference/stream/constants.xml:1.11 11:20:48 2004 <function>stream_socket_server</function> to start this flag. include this flag. http://cvs.php.net/diff.php/phpdoc/.../> r2=1.3&ty=u phpdoc/en/reference/stream/functions/stream-socket-accept.xml:1.2 phpdoc/en/reference/stream/functions/stream-socket-accept.xml:1.3 Thu Apr 1 01:31:14 2004 Sat Jul 31 07:48:38 2004 http://cvs.php.net/diff.php/phpdoc/... &r2=1.16&ty=u phpdoc/en/reference/stream/functions/stream-socket-server.xml:1.15 phpdoc/en/reference/stream/functions/stream-socket-server.xml:1.16 Wed Jun 16 09:01:22 2004 Sat Jul 31 07:48:38 2004 is <constant>STREAM_SERVER_LISTEN</constant>. <constant>STREAM_SERVER_BIND</constant> as connections STREAM_SERVER_BIND); STREAM_SERVER_BIND);
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.