ML

Limitrate

limitrate; V 1; 2005-12-16; limits flow rate of an input/output stream.

Synopsis and description

limitrate rate command [option ...]
  • rate -- maximum flow rate (bytes/s)

Prevents the data flow exceeding specified rate by calling the sleep subroutine after every read/write operation. Standard input and output streams are watched independently. Standard error is left untouched. Because of the program's simplicity the flow rate is only approximate however it should never exceed the given limit.

Downloading and compiling

Source code: Requirements:
  • POSIX threads
Compiling:
gcc -Wall -s -o limitrate limitrate.c -lpthread

Examples

  • with fetchmail and ssh, example configuration file, the ~/.fetchmailrc:

    poll my.mail.com with proto imap:
      plugin "ssh -C %h limitrate 20480 imapd" auth ssh;
      user foo is foo here
      smtphost myhost.com
      idle


    limits the input/output stream speed to 20 KB/s in each direction. With ssh's gzip compression turned on (-C) the actual transfer rate over network will be lower.
Valid HTML 4.01! Valid CSS! 2005-12-17
Matlib