7

I have a C# client application that connects to multiple servers. I noticed that it is necessary to use NetLimiter activated rules in order to make my client connect correctly with higher priority when there is so many traffic on the client computer.

I did not find any documents about how can I embed and make rules programmatically in this application. However, I read here that someone tried to use Netlimiter API but failed.

I read somewhere that I can write my own application that uses TC API of the Windows in here and mark DSCP to make priorities. But I reached to this problem before setting flow options of my C# application.

Please guide me with this issue.

Matin Lotfaliee
  • 1,745
  • 2
  • 21
  • 43
  • 1
    If you want to programmatically change how NetLimiter treats a program, you need to use the NetLimiter API. If NetLimiter is throwing errors, then you need to a) consult the NetLimiter documentation, and/r b) open a support call with NetLimiter. – paulsm4 May 13 '17 at 07:00
  • @paulsm4 where can I find the API? did not find any on its website. – Matin Lotfaliee May 13 '17 at 07:04

1 Answers1

3

Look here. Connect() and SetRule() are the only APIs available.

NetLimiter seems to be a COM object, so to use it from C# you need something like this:

dynamic myownlimiter = Activator.CreateInstance(Type.GetTypeFromProgID("NetLimiter.VirtualClient"));
myownlimiter.Connect("host", "port");

and then use SetRule() as described in the first link.

hidefromkgb
  • 5,834
  • 1
  • 13
  • 44
  • 1
    `Type.GetTypeFromProgID("NetLimiter.VirtualClient")` returns null – Matin Lotfaliee May 30 '17 at 07:57
  • @MatinLotfaliee the authors seem to have altered the class name. [Look here](https://stackoverflow.com/questions/660319/where-can-i-find-all-of-the-com-objects-that-can-be-created-in-powershell) to list all COM object names in your system and find the appropriate one. – hidefromkgb Jun 02 '17 at 13:17