http://qs1969.pair.com?node_id=410249


in reply to Re: Perl vs. PHP in streaming a file
in thread Perl vs. PHP in streaming a file

Thanks for your help so far. To the response of 280kbps I get the same speed out of my machine too with the perl script but for some reason the Tivo box really lags when I use perl, but not with php. My assumption is that the data is not reaching it fast enough, since this is a streaming file, but it could be another problem too. I am just trying to figure out what is different with PHP and perl in this respect.

And to answer the question why I don't use apache. I actually am, TiVo and the homemedia option always use an alias http://server/TiVoConnect so in order to make it function right I have to use a script to be able to determine what is a query or what is a data transmission.

Thanks again.

Replies are listed 'Best First'.
Re^2: Perl vs. PHP in streaming a file
by revdiablo (Prior) on Nov 24, 2004 at 21:47 UTC
    TiVo and the homemedia option always use an alias http://server/TiVoConnect so in order to make it function right I have to use a script to be able to determine what is a query or what is a data transmission.

    According to a document I found on TiVo's website, the TiVo uses two different request formats:

    http://{machine}/TiVoConnect?{parameters}
    Meta-data requests
    http://{machine}/TiVoConnect/{document}?{parameters}
    File requests

    These are different enough that you could use Apache's mod_rewrite to direct file requests directly to the file, and then you would need neither PHP nor Perl to serve them.

Re^2: Perl vs. PHP in streaming a file
by Ven'Tatsu (Deacon) on Nov 24, 2004 at 21:36 UTC
    If your getting that high throughput I'd venture a guess that speed is not your issue. Is your script running on windows? If you are running on Windows you will almost cretanly need binmode(filehandle). I didn't see it in the code you posted. With out it Perl will open the file assuming that it is text and it will likely corrupt it as it's read.