Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jpcap/jnetpcap monitoring

843790Jun 28 2010 — edited Jul 2 2010
My application lets the user choose a domain from a source list to fetch a bunch of subpages (using HttpURLConnection). To the user this looks like a single, large download. Multiple downloads may be running at once and I need to report their individual transfer rates to the gui. I attempted to create a TransferMonitor, but it isn't working as expected (thanks to ejp for your attempts to help out).

My second thought is to let an external library handle the actual monitoring. I think either jpcap, [sourceforge jpcap|http://jpcap.sourceforge.net/] or jnetpcap could do this. The idea is that I can use this library to get the download rate for the jvm process. If I keep track of the bytes downloaded by each thread per second I can compute a ratio and use this in combination with the download rate for the entire process to compute individual transfer rates for each thread.

However, I cannot find an example on how to monitor the download rate of a process using any of these libraries (or any other if such exists). Could someone that has done this before, or has a much better understanding of how this works, please post a sample on how I can accomplish this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 30 2010
Added on Jun 28 2010
4 comments
457 views