For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > July 2004 > Re: [PHP-DOC] cvs: phpdoc /en/reference/stream constants.xml /en/reference/stream/fun









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DOC] cvs: phpdoc /en/reference/stream constants.xml /en/reference/stream/fun
Nuno Lopes

2004-07-31, 8:55 am

> 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

[color=darkred]
> 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[color=darkred]
phpdoc/en/reference/stream/constants.xml:1.11[color=darkred]
11:20:48 2004[color=darkred]
<function>stream_socket_server</function>[color=darkred]
to start[color=darkred]
this flag.[color=darkred]
include this flag.[color=darkred]
http://cvs.php.net/diff.php/phpdoc/...1.2&r2=1.3&ty=u[color=darkred]
phpdoc/en/reference/stream/functions/stream-socket-accept.xml:1.2
phpdoc/en/reference/stream/functions/stream-socket-accept.xml:1.3[color=darkred]
Thu Apr 1 01:31:14 2004[color=darkred]
Sat Jul 31 07:48:38 2004[color=darkred]
http://cvs.php.net/diff.php/phpdoc/...15&r2=1.16&ty=u[color=darkred]
phpdoc/en/reference/stream/functions/stream-socket-server.xml:1.15
phpdoc/en/reference/stream/functions/stream-socket-server.xml:1.16[color=darkred]
Wed Jun 16 09:01:22 2004[color=darkred]
Sat Jul 31 07:48:38 2004[color=darkred]
is[color=darkred]
<constant>STREAM_SERVER_LISTEN</constant>.[color=darkred]
<constant>STREAM_SERVER_BIND</constant> as[color=darkred]
connections[color=darkred]
STREAM_SERVER_BIND);[color=darkred]
STREAM_SERVER_BIND);[color=darkred]
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com