Results 1 to 1 of 1
Thread: Sending files over network
- 04-15-2011, 09:28 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 1
- Rep Power
- 0
Sending files over network
Hello. I have made a simple server in java that sends requested files to clients via http://<ip>/<filename>. It creates a new thread for each client. The problem is the speed is limited to 100kBps per thread. I searched a little bit and I think I know the problem:
Java Code:FileInputStream input = null; DataOutputStream output = null; ... output = new DataOutputStream(client.getOutputStream()); //client = Socket ... input = new FileInputStream(requestedFile); ... int read; try { for(;;) { read = input.read(); if (read==-1) { break; } output.write(read); } } ... client.close();
Last edited by TerraViper-5; 04-15-2011 at 09:30 PM.
Similar Threads
-
sending and recieving files
By rav in forum New To JavaReplies: 9Last Post: 07-26-2010, 05:34 PM -
sending object through network/socket
By skandalouz in forum NetworkingReplies: 1Last Post: 12-24-2009, 08:34 AM -
Sending a key over network
By cst in forum NetworkingReplies: 0Last Post: 11-04-2009, 02:19 PM -
sending file over network
By qwerty in forum NetworkingReplies: 6Last Post: 04-25-2009, 02:55 AM -
Sending .GIF files over the network
By nadia in forum NetworkingReplies: 8Last Post: 12-30-2008, 12:57 PM
Bookmarks