Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

Upload speed test - Dial-up modem

843841May 12 2005 — edited May 12 2005
I'm writing speed test program in Java, and my upload speed test shows wrong result for Dial-up connection.
It uses POST method and sends large data (128k) to Apache 1.3.x web server (FreeBSD).
The web page is php script and it receives large data correct, but test time is "very" fast.


Result is unbelievable, it is something like 500kbps for 56kbps Dial-Up connection, which is completely wrong.


Can somebody tell me why is this happening? How can I correct this problem?
How can I calculate my upload speed? What data size should I use for testing?
I hope somebody in this list point me to the right direction.
Maybe I'm doing something wrong, or missing something.


thanks in advance,


Ganbold


Part of the Java code:
..........
buffer_len = 128*1024;
starttime1 = System.currentTimeMillis();
URL url = new URL(web_site);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);


PrintWriter out = new PrintWriter(connection.getOutputStream());
out.print("test=");
for(i=0; i<buffer_len;i++){
out.print('a');
}
out.println("");
out.close();


BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));
String inputLine;


while ((inputLine = in.readLine()) != null){
// System.out.println(inputLine);
}
in.close();
endtime1 = System.currentTimeMillis();
test_time = endtime1 - starttime1;


uploaded_size = buffer_len;
return showSpeed(starttime1,endtime1,"Upload",buffer_len);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2005
Added on May 12 2005
2 comments
131 views