Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-12-2008, 04:09 PM
Member
 
Join Date: Mar 2008
Posts: 2
breznev is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-12-2008, 09:49 PM
Member
 
Join Date: Mar 2008
Posts: 2
breznev is on a distinguished road
no one?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-12-2008, 10:03 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement HttpSessionListener in JSP Srikanth816 JavaServer Pages (JSP) and JSTL 1 04-16-2008 10:22 AM
how to implement progress bar ..... roshithmca AWT / Swing 1 03-06-2008 05:18 PM
server downloads ai_2007 Advanced Java 1 07-31-2007 01:16 PM
How to implement Cut and Paste Jamie AWT / Swing 2 05-31-2007 07:15 PM
How can we implement IPC in java samson Networking 1 04-04-2007 07:38 AM


All times are GMT +3. The time now is 05:19 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org