3

I'm looking for a way to transfer a file over UDP at an specific bitrate. I can use netcat for example like this:

cat file | nc -u 192.168.x.x 5000

And I use a custom application to listen at port 5000 at client side.

Is there any way to "cat a file raw to udp" at a specific bitrate?

1
  • Do you want a min or max bitrate when writing that file?
    – ott--
    Aug 10, 2013 at 20:54

1 Answer 1

8

PV (Pipe Viewer) has the ability to rate-limit a pipe.

pv -L 512k

-L RATE, --rate-limit RATE Limit the transfer to a maximum of RATE bytes per second. A suffix of "k", "m", "g", or "t" can be added to denote kilobytes (*1024), megabytes, and so on.

You can either install it from source from here or install it with a package manager for your distribution.

So you'd do:

cat file | pv -L 512k | nc -u 192.168.x.x 5000

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .