C Linux Bandwidth Throttling of Application

后端 未结 2 612
醉酒成梦
醉酒成梦 2021-01-14 15:01

What are some ways I can try to throttle back a send/sendto() function inside a loop. I am creating a port scanner for my network and I tried two m

2条回答
  •  生来不讨喜
    2021-01-14 15:29

    If you'd like to do this at the application level, you could use a utility such as trickle to limit or shape the socket transfer rates available to the application.

    For instance,

    trickle -s -d 50 -w 100 firefox
    

    would start firefox with a max download rate of 50KB/s and a peak detection window of 100KB. Changing these values may produce something suitable for your application testing.

提交回复
热议问题