How to get Received & Sent Network Bytes per second For a process (input: process id or handle) in C++ for Windows? -


i need network information per process in resource monitor. need find received bytes/s & sent bytes/s.

i tried using win32_perfrawdata_perfproc_process class. gives io, file bytes in addition network details.

i tried details using win32_perfrawdata_tcpip_networkinterface class. gives details per network interface.

then tried use gettcpstatistics function. mib_ipstats has been used. mib_ipstats shows cumulative results entire process.

  1. are there other mib structures show these details per process manner?
  2. how bytes/s thing per process in resource monitor shown in win32_perfrawdata_tcpip_networkinterface cumulated data entire processes
  3. can calculate bytes/s using win32_perfrawdata_perfproc_process class based on other values?
  4. are there methods getprocessmemoryinfo ( method process memory) received , sent bytes per sec?
  5. are there other methods calculate them?

you might try looking performance counters.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa373083(v=vs.85).aspx

here code project example of getting network speed using performance counters. in c# should able translate c++.

http://www.codeproject.com/articles/6259/monitoring-network-speed'


Comments