Richard Lynch wrote:
>Secondly, I think it's probably just a Bad Idea (tm) to try to force HTTP to
>do 2 files in one connection anyway -- It just complicates your life, and is
>giving you headaches already... How much worse will it get in a year?
Actually, it's a very good idea and very well supported. Even with
HTTP/1.0, Web servers support persistent connections; the client simply
has to ask for it with the "Connection: Keep-Alive" header. In HTTP/1.1
(obviously the Web server he was dealing with), you have to ask for the
server to close the connection with a "Connection: Close" header,
because persistent connections are the default behavior.
>That said, I suspect that fgets() is looking for a particular character all
>by itself on a line that determines the end of a file. Control-D, possibly.
>So, *MAYBE* sending a chr(4) (control-D) after each file will work...
The problem has nothing to do with fgets actually. If the Web server
doesn't close the connection, the client doesn't close the connection,
and the client endlessly loops waiting for more content, it's going to
hang. That's to be expected. :)
>Disclaimer: I'm not promising any of this is correct -- mostly guess-work
I explained this more thoroughly here:
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php