Bandwidth/speed limiter java
843790Apr 18 2008 — edited Sep 19 2008Hi,
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