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?

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

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
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.