简体   繁体   English

在lan C ++ Windows中控制以太网速度

[英]controlling ethernet speeds in lan c++ windows

I am wondering if it is possible to limit/control ethernet upload and download speeds on specific transport layers (tcp/udp) using c++? 我想知道是否可以使用C ++限制/控制特定传输层(tcp / udp)上的以太网上传和下载速度? I am trying to make a simple to use program that can control the speeds of any device that the ethernet is connected to. 我正在尝试制作一个易于使用的程序,该程序可以控制以太网连接到的任何设备的速度。 For example: Computer B is connected to computer A via Internet Connection Sharing, I use my program to limit computer B's download or upload speed to 120kbs (or any number i choose), with this I would also like to choose udp or tcp. 例如:计算机B通过Internet连接共享连接到计算机A,我使用我的程序将计算机B的下载或上载速度限制为120kbs(或我选择的任何数字),因此我也想选择udp或tcp。

Basically, I want to create my own program similar to net limiter and other such software, but I also want to add my own features which many of which lack for my needs. 基本上,我想创建自己的程序,类似于net limiter和其他此类软件,但是我也想添加自己的功能,其中许多功能都无法满足我的需求。 These other features are easy enough, but I have no idea how to go about the actual limting process. 这些其他功能很容易,但是我不知道如何进行实际的限制过程。

The way forward in the general case you ask about would be to create a virtual network adapter and all the monitored route traffic through it. 在您所询问的一般情况下,前进的方式是创建一个虚拟网络适配器,并通过它来监视所有路由流量。 Once that was done, then you can monitor streams between hosts or on specific ports. 完成后,您可以监视主机之间或特定端口上的流。

Not an easy job... A starting point would be the Windows device driver kit. 绝非易事... Windows设备驱动程序工具包是一个起点。

If you were prepared to limit just one app, and could modify it, the task would be much simpler... wget and curl for example both offer limiting. 如果您准备仅限制一个应用程序并可以对其进行修改,则任务将更加简单...例如,wget和curl都提供了限制。

HTH, Ruth 露丝·HTH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM