Giter VIP home page Giter VIP logo

Comments (2)

Nathipha avatar Nathipha commented on June 6, 2024

Found the problem:
In "stream" mode (which is the default setting afaik) a data socket can only be used for a single e.g. RETR. Afterwards it sends 226 and closes itself. dataSocket.isConnected then still returns true but another RETR only returns 0 bytes, use dataSocket.remoteConnectionClosed instead to check.

To download multiple files open a new data socket with a new passive connection for every file:

Login + connect cmdSocket
cmdSocket send: CWD myFolder
cmdSocket receive: 250 CWD command successful
cmdSocket send: TYPE I
cmdSocket receive: 200 Type set to I
Loop through all the files
cmdSocket send: PASV
cmdSocket receive: 227 Entering Passive Mode
Connect dataSocket to Passive Mode IP/port
cmdSocket send: RETR myFileX
cmdSocket receive: Either "150 Downloading in BINARY file" or "125 Data connection already open; Transfer starting"
dataSocket: Receive data with "read(into data: inout Data)" & write it to the "Documents" folder
cmdSocket receive: 226 Transfer complete
Close the dataSocket (not sure if still necessary)

from bluesocket.

dannys42 avatar dannys42 commented on June 6, 2024

@Nathipha Thanks for updating with your resolution.

from bluesocket.

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.