Skip to content

"readString" not returning everything (FTP) #176

Description

@Nathipha

First of all: Thanks for writing a library that works with an FTP server and is easy to use!

I created a new app in Xcode 10 with Swift 5 and the latest version of BlueSocket (installed via CocoaPod) to test it and I've come across a problem:

I can open a normal and a data socket to the FTP server and log in using cmdsocket.write(from: "USER \(username)\r\n") just fine (you can find a list of ftp codes here) but

try cmdSocket.write(from: "LIST\r\n")
let answer = try dataSocket.readString(true)
print(\(answer))

which should list the files and folders at the root only prints the very first one. It's working with a different server (e.g. "speedtest.tele2.net" is free to use for testing), so it looks like "my" server is too slow and/or the library is too fast (and possibly not waiting until the server is done?).

Is there a way to set some kind of timeout for that, e.g. if you don't get a result for the third time, stop reading, instead of stopping after the first try?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions