tags:

views:

43

answers:

1

I'm trying to collect network statistics on my computer and draw a pie chart. An example is shown below.

my computer connects to port 80   75%
my computer connects to port 443  20%
my computer connects to port 443  5%

But I don't know how to get each port that my machine is connecting to.

I will be using Java to develop this.

A: 

You should check out jNetPcap, which allows you to monitor network traffic.

http://jnetpcap.com/

ar