File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Network activity monitor

 
Maysam Sorkhabi
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I share a cable connection in between two computers using a router. I'd like to write a little Java programs that constantly shows the bandwidth usage of each computer. i.e. I'd like to see how much data is uploaded over the cable connection from say my mom's computer. I'd like to have this as a little diagnostic tool. Any ideas about how this can be done?
Thanks

(p.s. I have some background in internet programing using Java, so feel free to go all out technical)
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'd have to get into some pretty low level APIs in your TCP-IP stack or even hardware drivers. Java likely won't do that kind of thing directly as it is OS and hardware independent. You might be able to do the low level monitoring in C/C++ and put a Java user interface or business layer on top of that with JNI.

Have you ever seen any code that does this kind of thing?
 
Maysam Sorkhabi
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No Sir I really haven't. I was more thinking of some already implemented class\methods that would carry out this operation. But anyway thank for replying.
 
Elihu Smails
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have 2 processes you could roll your own InputStream to measure network performance. Otherwise, you are out of luck.
 
Paul Santa Maria
Ranch Hand
Posts: 236
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If SNMP is enabled on the host, and if you have the correct administrative privileges, you can query the OS-level network performance counters using Java and SNMP.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic