5

I am developing a Network based Client Server Application where "internet time" is allocated to a client on the computer, which then logs in and use it, but I need a way to also monitor the bandwidth the client uses. I am writing in Java, I know it can be done as we are using such program currently(Bought it few years back) but it is outdated and lacking features.

If it might be an easier job to just monitor the usage of let say, IE, Firefox and Chrome?

Now I am looking for any links to tutorials, help, push in the right direction. I am lost to how to start at it. Tried searching the web, I got a few stuff but can't seem to get the code working as they only give in incomplete.

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
Theron084
  • 155
  • 2
  • 3
  • 11

2 Answers2

2

Here is the link to code which is termed as Internet Bandwidth Monitor. It is simple tool that monitors the uploads and downloads with graph.

nebula
  • 3,932
  • 13
  • 53
  • 82
  • Hi, thanks. I checked it out, I can't get it to work though, I get a runtime error (java.lang.UnsatisfiedLinkError: no jpcap in java.library.path). It is somewhere at the network Interface. I am not even closely familiar with the coding used so I can't try and fix it. Would you mind running it on your side and see if you can shed some light onto the subject? That would be much appreciated. – Theron084 Nov 29 '11 at 15:34
  • it works perfectly. You need to add the APIs. jpcap is a API used in that code. – nebula Nov 29 '11 at 15:50
  • Thats weired, I Opened the project in Netbeans. It asked me to add the API, I Selected them all, them when I run it, it opens but counts no bandwidth: but I get this error: READ BELOW: Although all is added. I will try and re-add them all now – Theron084 Nov 29 '11 at 16:53
  • Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: no jpcap in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860) at java.lang.Runtime.loadLibrary0(Runtime.java:845) at java.lang.System.loadLibrary(System.java:1084) at jpcap.JpcapCaptor.(JpcapCaptor.java:251) at bandwidthcalculator.PacketMonitoringThread.run(PacketMonitoringThread.java:13) Total size and reset: 0.0 Total size and reset: 0.0 Total size and reset: 0.0 – Theron084 Nov 29 '11 at 16:53
  • Well. i guess you are right. Something is wrong with the code. It was written by one of my friend. You can write review in the site so that he can fix the issue. – nebula Nov 29 '11 at 17:04
  • Well, it works now. See readme.txt before using the tool. You have to install jpcap.exe before using this tool. – nebula Dec 01 '11 at 14:37
  • Thanks, yes, it has no errors I can see, but when I run the pre-built one and do some stuff on the internet, it doesn't count it? – Theron084 Dec 01 '11 at 15:12
2

A servlet filter that does band width monitoring and possibly throttling might do nicely.

Joop Eggen
  • 107,315
  • 7
  • 83
  • 138
  • I didn't get you, how servlet filter do this job – user2826111 Oct 23 '13 at 05:37
  • @user2826111 HTTP request -> Servlet Filter 1 -> ... Servlet Filter n -> Servlet -> back to Servlet Filter n -> 1 -> HTTP response. So throttling, slowing down is possible. Band width monitoring needs a bit more. – Joop Eggen Oct 23 '13 at 06:10