Thursday, November 28, 2002 04:29 AM
Thanks for the tips.
The problem is now located and it appears to relate to the way the web server handles the client socket/connection.
There is only a -1 on the stream if the web server has closed the connection.
Of course, most modern webservers are configured to use keep-alive if no
Connection: close HTTP header is sent to them.
The connection therefore does not get closed until some inactivity timeout occurs on the web server, so the code above gets stuck in a loop for a while.