Code Monkey home page Code Monkey logo

Comments (3)

JiPaix avatar JiPaix commented on May 30, 2024

Resuming downloads means xdccJS would need some kind of database to store information about every interrupted download (botname, bot IP, package number, filename, port used).
Even worse, query the database EVERY TIME a download is started to automate the thing (to avoid using a resume() function).

I'm not sure i want to dive into that, as i'd like to keep xdccJS as light as possible. I'll think about it.

BUT !
If the idea of resuming comes from failed downloads, you could still restart it (from the beginning) like this :

// will retry indefinitely until file is downloaded
let download = () => {
  xdccJS.download('bot', '#2')
}
download()
xdccJS.on('download-err', () => {
  download()
}

from xdccjs.

JiPaix avatar JiPaix commented on May 30, 2024

In case i change my mind here's a reminder on how DCC resume works:

DCC Resume Protocol
User1 is sending the file.
User2 is receiving the file.

If User2 chooses to resume a file transfer of an existing file, the following negotiation takes place:
User2 sends:

PRIVMSG User1 :DCC RESUME filename port position

  • filename = the filename sent by User1.
  • port = the port number sent by User1.
  • position = the current size of the file that User2 has.

User1 then responds:

PRIVMSG User2 :DCC ACCEPT filename port position

from xdccjs.

JiPaix avatar JiPaix commented on May 30, 2024

Resuming downloads means xdccJS would need some kind of database to store information about every interrupted download (botname, bot IP, package number, filename, port used).

I was totally wrong about that: if the file already exist the xdcc protocol just needs a second handshake (using DCC RESUME) specifying the file position.

from xdccjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.