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!

Bandwidth/speed limiter java

843790Apr 18 2008 — edited Sep 19 2008
Hi,

I am working on a ftp application and was wondering if anyone knows a way to determine and limit the current upload speed of a connection.

I don't know the exact code that will be helpful but some info from my app:

Use Socket() to connect to ftp server.
the outputstream (os) is from socket().getOutputStream();
byte[] buf= new byte[16384]; c = is.read();
then I upload using os.write(buf, 0, c);

Essentially I am looking for a method to lower the upload bandwidth consumption of my program so users can browse the internet and such simutaneously. I am hoping that there might be some function in the java packages made for this or a small method that doesn't have to doesn't hog much cpu resources. Any help would be appreciated. Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2008
Added on Apr 18 2008
8 comments
1,032 views