I wrote a little Java program that exceedingly uses the internet connection. In multiple parallel threads the program fetches multiple websites. These threads are now intelligent enough to shut themselves down on connection timeout. I would also like them to start opening connections again the moment there is enough bandwith available. My only reasonble idea so far would be to check the current network utilization at shutdown and to start again when it sunk far enough.
How could i do this? Do you have other ideas on how to solve my problem?
Possibly useful annotation: I fetch websites via JSoup