Results 1 to 3 of 3
  1. #1
    breznev is offline Member
    Join Date
    Mar 2008
    Posts
    2
    Rep Power
    0

    Default How to implement multiple peers downloads

    Hi everybody,

    I need some help about implementation of multiplesource downloads, that is a certain number of identical files which are downloaded from various peers by a user, enhancing the download speed.

    I think that I should divide the file, download the various parts and then reunite them, but I really don't know how to do this. Could someone post some example of code?

    (the protocol is TCP/IP)

    Thank you a lot :)

  2. #2
    breznev is offline Member
    Join Date
    Mar 2008
    Posts
    2
    Rep Power
    0

    Default

    no one? :(

  3. #3
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

    Default

    First of all, chekc sun's tutorial on sockets. You will use sockets to implement this.

    Second, You will write a simple protocol for this. It is not difficult to write, it is difficult to debug :). Check sun's protocol as an example. For your case, i guess the best way is to implement the protocol as follows:

    Each thread will request different parts of your file from different sources. Starting byte and ending byte are enough to characterize that info.

    1. Send start byte to the server
    2. Send end byte to the server
    3. Download this part to a buffer
    4. Do above steps until no parts are remaining
    5. Combine downloaded buffers as the final file

Similar Threads

  1. How to implement HttpSessionListener in JSP
    By Srikanth816 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-16-2008, 09:22 AM
  2. how to implement progress bar .....
    By roshithmca in forum AWT / Swing
    Replies: 1
    Last Post: 03-06-2008, 04:18 PM
  3. server downloads
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 12:16 PM
  4. How to implement Cut and Paste
    By Jamie in forum AWT / Swing
    Replies: 2
    Last Post: 05-31-2007, 06:15 PM
  5. How can we implement IPC in java
    By samson in forum Networking
    Replies: 1
    Last Post: 04-04-2007, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •