Thread: File resuming, and multiple sources

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    4

    File resuming, and multiple sources

    I am wondering how it would be possible to resume a file download/send (without using raw sockets), and how to support downloading from multiple sources. Thanks in advance for the advice!

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Using what protocol?
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    4
    Dunno....I was gunna probably have to create my own. Any ideas on how this would be accomplished would be greatly appreciated.

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You'd basicly need to create a list of what file chunks you have, and/or what ones you need. Also, you'd need to know what size the file is, or have to have a way for the sender to notify you that you've just been sent the end of that file.

    Then, basicly what I'm thinking is you'd do something like:

    source1, send me chunk 5
    source2, send me chunk 8
    source ...

    And you'd stick the chunks in where they belong. A chunk would just be a bit of data of an arbitrary size that you've specified. You could do this by something like:

    fseek to CHUNKSIZE * CHUNKTOGET, and read CHUNKSIZE into a buffer.
    Now send that chunk to the client in whatever wrapper you've created. You then take that, unwrap it, and seek to your output file and write it in the correct spot.

    That sound about right?

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed