Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: FTP Status 1002  (Read 11938 times)

0 Members and 1 Guest are viewing this topic.

Niely

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: FTP Status 1002
« Reply #15 on: January 04, 2015, 09:29:35 pm »
getMessage is blanco. The response of connect is 1001, login 1002.

Ouput:
Quote
Connecting Not ok; Status 1001
Logging in Not ok; Status 1002

Code:
#include <iostream>
#include <string>

#include <SFML/Network.hpp>

using namespace std;
int main() {
sf::Ftp ftp;
sf::Ftp::Response response, response2;
/*string server, username, password;
int port;


cin >> server;
cin >> port;
*/

response = ftp.connect("ftp://server.cf");
/*
cin >> username;
cin >> password;
*/

response2 = ftp.login("myUser", "MyPass");

if (response.isOk()) {
        cout<< "Ok" <<endl;
} else if (!response.isOk()) {
        cout << "Connecting Not ok; Status " << response.getStatus()<< " " << response.getMessage()<<endl;
} else {
        cout<< "Error" <<endl;
}

if (response2.isOk()) {
        cout<< "Ok" <<endl;
} else if (!response2.isOk()) {
        cout << "Logging in Not ok; Status " << response2.getStatus()<< " " << response2.getMessage()<<endl;
} else {
        cout<< "Error" <<endl;
}
}

I used interface Wlan0, also tried FTP filter; the same result.
Not using local ftp-server, but a normal over-internet one.
« Last Edit: January 04, 2015, 09:58:54 pm by Niely »

Demir

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • Email
Re: FTP Status 1002
« Reply #16 on: January 04, 2015, 09:33:09 pm »
I'm not good at networking.
I try to follow what's new in the current version of SFML.


I worked with sf::Ftp a bit.

As I can see getaddrinfo() function doesn't like ftp:// prefix.

Niely

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: FTP Status 1002
« Reply #17 on: January 04, 2015, 09:58:06 pm »
What exactly do you mean?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: FTP Status 1002
« Reply #18 on: January 04, 2015, 10:05:53 pm »
Just use server.cf instead of ftp://server.cf.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: FTP Status 1002
« Reply #19 on: January 04, 2015, 10:56:41 pm »
Quote
The response of connect is 1001
So... that is the problem. You cannot connect to the server at all, and yes this is probably because of the "ftp://" prefix.

That's why checking every possible call that reports a status is important: otherwise you may look for a bug at the wrong place.
Laurent Gomila - SFML developer

Niely

  • Full Member
  • ***
  • Posts: 101
    • View Profile
Re: FTP Status 1002
« Reply #20 on: January 06, 2015, 08:51:37 pm »
^It's indeed connecting now. :)
Thanks a lot all!

However, I still have to change a few things to make it do more what I want.