Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Here's one way. If you supply the hash => \*FHGLOB parameter on the Net:FTP constructor, then a "hash mark" will be printed to the Filehandle glob each buffer load. If you tie the glob before passing it, the PRINT method will be called after each buffer is read. If you insert a short sleep at that point, you will effectively throttle the request for the buffer load. This demonstrates the technique. Performing the calculations to allow the download rate to be specified and wrapping it up into clean interface is left as an exercise for those that need it.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In reply to Re: Ways to limit bandwidth of downloads?
by BrowserUk
|
|