Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTPFileProvider.isReachable returns error, even though everything's working properly #154

Open
Nathipha opened this issue Jun 18, 2019 · 3 comments

Comments

@Nathipha
Copy link

Nathipha commented Jun 18, 2019

I'm using the latest version of the library (with Swift 5, Xcode 10) and have just run into the same problem as the author of this closed one:

ftpProvider?.isReachable(completionHandler: { (success, error) in
    print("Success: \(success), Error: \(error)")
    if success {
        //Continue
    } else {
        //Show error message
    }
})

pretty much instantly always "fails" with the error:

Success: false, Error: Optional(Error Domain=NSURLErrorDomain Code=-1011 "(null)" UserInfo={NSErrorFailingURLKey=ftp://10.1.1.15:16/, NSURL=ftp://10.1.1.15:16/, NSErrorFailingURLStringKey=ftp://10.1.1.15:16/})

error!.localizedDescription gives some more information and is output twice (!):

Success: false, Error: The operation couldn’t be completed. (NSURLErrorDomain error -1011.)

If I ignore "success", I can:

  • log into the ftp server
  • list files with ".contentsOfDirectory()"
  • read files with ".contents()"
  • download files with ".copyItem()"

just fine and there are no more error messages (still dealing with everything being done twice but that's are different problem).

If I give it an invalid URL, the output after about a minute is pretty similar (the error code is the only difference):

Success: false, Error: The operation couldn’t be completed. (NSURLErrorDomain error -1001.)

Why is it throwing an error message, even though login seems to work and complete just fine?

@Nathipha Nathipha changed the title FTPFileProvider.isReachable resturns error, even though everything's working properly FTPFileProvider.isReachable returns error, even though everything's working properly Jun 18, 2019
@Stermop
Copy link

Stermop commented Sep 6, 2019

I have the same problem, is there a solution? thank you.

@Nathipha
Copy link
Author

Nathipha commented Sep 9, 2019

@Stermop I didn't find a solution when I was using the library. I ended up checking what error code means what and then just ignored the error that was thrown when it was successful.

I'm not using the library anymore though because it doesn't look like @amosavian is supporting it any more and there are a lot more problems than just this one: Even though they are small, the last one I found made the library unusable for me (simply didn't work with my server), so now I'm using BlueSocket and built my own reading/writing library around it.

@Stermop
Copy link

Stermop commented Sep 9, 2019

@Nathipha Thank you, I've found the solution for this problem, insert return in line 324 of FTPFileProvider.swift will be ok.

But FTPFileProvider.isReachable still returns error, I will try other ways to solve my problems. Thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants