[geeklog-devtalk] PHP/CGI Question

Tony Bibbs tony at tonybibbs.com
Fri Apr 2 00:40:55 EST 2004


In this case I don't think there is much you can do since the web is a
stateless environment and PHP has no concept of threading. Only thing
you might try the built in PHP buffering features but even then I don't
think that would help at all. Try #php in irc.freenode.net, some smart
guys lurk there. I'd be interested to hear if there is such a way to
handle this.

--Tony

Steve Sloan wrote:


> Hey guys, hope you don't mind a slightly OT question. I'm working on

> a plugin to do music distribution for my band web page. The "fetch"

> script is fairly simple, and just spits out the appropriate headers

> (streaming vs. download, content type, etc.) and the dumps the song

> data (with readfile). At the end, I have it update per-song and

> per-format hit counters, so I can see exactly how unpopular we are.

>

> My problem is that, if the transfer doesn't complete, the hit counters

> still get updated. I'd like some way to detect if the connection is

> closed. Normally, IIRC, in CGI apps this is indicated by a closing of

> stdout, and an error write. My PHP script, though, behaves as if the

> transfer completes immediately. I've tried several other methods --

> passthru(), read()/write() -- and they all behave the same. Any ideas?

>

> Thanks ...

>

> --Steve

> _______________________________________________

> geeklog-devtalk mailing list

> geeklog-devtalk at lists.geeklog.net

> http://lists.geeklog.net/listinfo/geeklog-devtalk






More information about the geeklog-devtalk mailing list