Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Network activity monitor

 
Greenhorn
Posts: 23
  • 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)
 
(instanceof Sidekick)
Posts: 8791
  • 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
  • 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.
 
Ranch Hand
Posts: 37
  • 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.
 
Ranch Hand
Posts: 236
  • 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.
 
My pie came with a little toothpic holding up this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic