Re: Program "freezes" while sending large amounts of data...
| From: | Christian Weiske | Date: | Tue, 28 Sep 2004 06:35:08 +0000 |
| Subject: | Re: Program "freezes" while sending large amounts of data... | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5116@lists.php.net to get a copy of this message | ||
Hi
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
It works, but for some reason it's very slow with large files. It seems to That's because you do the sending with php. The "real" routines are implemented in c and a lot faster.
Any idea how this could be sped up while keeping the program responsive to user input? If you could use a ftp or http connection and are on *nix, you could pipe the output of a command line program to a file and read the status from this file every second. This would keep you program fully reacting, but it's harder to implement.
My guess would be the substr() stuff is the culprit, but there doesn't seem to be a suitable replacements for fget() when using fputs(). There is a "split" function in php which allows you to split strings into arrays of pieces of a certain length. This should do the job. (Don't know if the function is called "split").Regards/MfG, Christian Weiske -- XMMS is playing now: Norah Jones - Come away with me - 03 - cold cold heart
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc