Reputation:
Is there any way that java can detect that I have just plugged in a wired-network, and monitor it's bandwith? (I'm using linux, if that matters)
Upvotes: 2
Views: 2381
Reputation: 63538
You can run the program
/sbin/ip monitor
And monitor its output using a pipe or whatever.
It will tell you when
The output is somewhat confusing but should be parseable.
Upvotes: 0
Reputation: 116304
For the sake of simplicity and without using native code, you could try to using java.net.NetworkInterface with polling, so every X seconds you trigger a network interface enumeration in order to see if there are new interfaces.
Upvotes: 1