What APIs can I use for my specific bandwidth throttling requirements?

108 views Asked by At

I need to know what APIs I can use to make the following happen:

  • I have an existing process running on a Windows machine (call it application A), which can be any existing process on this Windows machine.
  • I want to code another application to throttle the bandwidth usage of A (call it application B).
  • B should be able to throttle A's cumulative upload and download speed separately. For example, if A has a maximum of 5 Kbps allotted to upload, then all of A's upload streams will be capped to a cumulative amount of 5 Kbps.

My requirements:

  • I cannot use a kernel-mode driver.
  • I need to make it a universal solution, so B can throttle any other process on a system (in other words, I can't change the source code of A).

I have tried to research into this, especially on Stack Overflow but could not find anything useful for my case:

  • I have seen this example of using a ThrottledStream class wrapper around a Stream object that will introduce throttling when used, but I need this to be a universal application, so I cannot use this approach (I can't change the source code of A).
  • I have seen this question who's answer speaks about using the Windows Filtering Platform API. Unfortunately, a requirement I have is that I absolutely can't use a kernel-mode driver to accomplish this, and my understanding is that the WFP API requires one.

Does anyone know what APIs can I use for my specific bandwidth throttling requirements in order to make B throttle the bandwidth usage of A?

0

There are 0 answers