I found tc, which allows you to filter by ip, port etc. and then limit rates. But I was wondering if there was anything that could filter by application or limit rate given another process' socket ..
Thanks!
ok seems like
I can use lsof -iTCP and ipfw pipes ... wonder how efficient that is ..
lsof -iTCP: http://danielmiessler.com/study/lsof/
ipfw: http://www.macgeekery.com/hacks/software/traffic_shaping_in_mac_os_x
ipfw in C: http://psb.sbras.ru/cgi-bin/www/unix_help/unix-man?ipfw+4
with rate limiting (dummynet): http://www.opensource.apple.com/source/network_cmds/network_cmds-115.2/ipfw.tproj/ipfw.c