Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
197 views
in Technique[技术] by (71.8m points)

c++ - Obtaining Current Network Rate

I would like to obtain the current network transfer rate of download/upload. This is for a C++ gameserver DLL and the primary objective of this is to best predict the upper-latency limit to kick players from the server, when their latency is too high. Basically, a players' ping influences the fluency of their movements, and higher latency leads to more delayed movement, meaning that we need to get rid of the player if it becomes too high. This is to mainly keep players happy.

Via the internal functions of the gameserver I can get the internal process upload/download rates, but I cannot get Windows'.

I've looked pretty much everywhere, and have done so on-and-off for quite a few months. The only solutions I can find don't work, and the rest are specific to Linux. The supported platforms (if it matters) are Windows Server 2008 R2 and Windows 7. The compiler is Microsoft Visual Studio Ultimate 2013's default compiler.

Edit

Forgot to mention that my gameserver DLL will eventually be running on a dedicated server with no less than four IPs, so it needs to be able to measure the connection upload/download (at the current rate) for all the IPs collectively.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I found a GUI application that offers the same functionality:

GUI Application

GUI Application Source

I guess that I should be able to extract the necessary libraries from this project, then use them in my own project. As my IPs all use the same 1GBPS network interface, it should be able to work to my requirements fine.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...