mcalpine wrote:
the problem with getting a php app to create other php processes is that the master cant close until the others have completed.
Is that a problem? You're running this all under the CLI SAPI anyway, so it shouldn't matter. Nothing will timeout, it should take as long as it takes.
the problem im having with the sockets is that when spidering a dynamic page (no content-length is sent), the socket functions sit open, waiting for data even thouht the server has completed the send.... they wait until they time out... which is a waste of time....
is there something im doing wrong?
If you're writing your own HTTP implementation (DO NOT DO THIS), then this means that your HTTP implementation is incorrect. Probably you've written an incorrect HTTP 1.1 implementation.
Don't write your own HTTP implementation. It will be buggy and complicated. Use PHP's built-in one, which works perfectly well. I've used it to fetch static and dynamic pages, and never experienced this problem.
Do not use "curl", which is now semi-deprecated anyway because PHP's had its own, better integrated, HTTP implementation in for ages.
If you want to do (for example) POSTs or set other headers, you can use stream_context_create (or whatever) and set stream context options to allow all necessary things to happen. Then just fopen your URL and read it in with fread()
Mark