Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I decided to write an answer because comments are too small.</p> <p>Well, reading other Q&amp;A on stackoverflow and looking around on the internet, I didn't find a simple solution for your problem.</p> <p>Actually, for .NET processes is really simple, you just need to retrieve informations from <em>".NET CLR Networking - Bytes Received/Bytes Sent"</em> performance counters, as shown in this <a href="https://stackoverflow.com/questions/442409/c-bandwidth/442459#442459">Q&amp;A</a></p> <p>But in general, getting per-process used bandwidth isn't an easy work.</p> <p>For example <em>"Microsoft Network Monitor"</em> sniffer can trace the process that generates internet packets only for TCP traffic, because probably it maps IP-port pairs with processes using them (or something similar, TCP is a <a href="http://en.wikipedia.org/wiki/Connection-oriented_protocol" rel="nofollow noreferrer">connected protocol</a> so it is simpler).<br> Anyway if you want to give it a try you can use the exposed API (look at <a href="http://blogs.technet.com/b/netmon/archive/2008/10/29/intro-to-the-network-monitor-api.aspx" rel="nofollow noreferrer">this</a> blog entry for some hint).</p> <p>However, as suggested in these Q&amp;A's (<a href="https://stackoverflow.com/questions/630285/programmatically-getting-per-process-network-statistics-on-windows">LINK 1</a>, <a href="https://stackoverflow.com/questions/438240/monitor-a-processs-network-usage">LINK 2</a>), the right, and probably the only way, is to write a NDIS/TDI driver that can intercept network traffic and exposing a .NET callable API to it.</p> <p>The problem is that such drivers can't be written in managed code, and so you need to implement it in C/C++.<br> Obviously, if you manage to find an already written driver/sniffer exposing a callable API, you can use it.<br> For example <a href="http://www.winpcap.org/" rel="nofollow noreferrer">WinPCap</a> has one (and some .NET wrappers like <a href="http://sourceforge.net/projects/sharppcap/" rel="nofollow noreferrer">SharpPCap</a> or <a href="http://pcapdotnet.codeplex.com/" rel="nofollow noreferrer">PCap.Net</a>), but I don't think (not sure) it's able to get packets's source-process information.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload