Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine network interface bandwidth/type without transferring data

Is there any way in Win32 to programmatically determine the bandwidth of a given network interface without actually transferring any data? I only want to distinguish between different types of interface (e.g. dialup vs DSL vs LAN), so a rough order of magnitude is fine, I don't need to actually measure the bandwidth.

Background to the problem is that my application is very bandwidth-hungry, and I want to display a warning to the user if they try and run it over a low-bandwidth interface, e.g. dialup modem or GPRS modem.

I've looked at some other related questions but if possible I'd like to avoid measuring throughput. GPRS modems in particular may have usage caps and I don't want to eat into a user's allowance - I'd rather detect the poor connection some other way and not actually send any data at all.

I'm most interested in Win32/C++ answers, but any ideas would be gratefully received.

like image 991
snowcrash09 Avatar asked Dec 13 '22 04:12

snowcrash09


1 Answers

You could use a WMI query, there are of course Win32 functions calls as well, but this query:

Select * from Win32_PerfFormattedData_Tcpip_NetworkInterface
like image 70
BobbyShaftoe Avatar answered Apr 27 '23 18:04

BobbyShaftoe