Reputation: 1805
I'm creating a java application where each client is isolated, the application will have a data plan where a limit of storage and bandwidth is set, measuring storage is already done, but bandwidth.. I have no idea
Upvotes: 3
Views: 3135
Reputation: 49187
See this thread if you want to limit bandwidth. In short there seems to be no good way but to interleave sending bytes with Thread.sleep().
If you however wish to monitor bandwidth you can do that e.g., by measuring the time taken to send a fixed number of bytes over the network, as described in Java Distributed Computed.
Upvotes: 2