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

Author Topic: SFML sf::IpAddress 2019  (Read 935 times)

0 Members and 1 Guest are viewing this topic.

innoox

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
SFML sf::IpAddress 2019
« on: December 15, 2019, 06:56:59 pm »
Good day everyone,
Is it still impossible to work with IPv6 via SFML?
I've got a task at the university to create IPv6 scanner.
Quote
sf::TcpSocket sock;
    sf::IpAddress address("::1");
    //sf::IpAddress address("www.google.com");
    cout << "address: " << address << endl;
    if (sock.connect(address, 80) != sf::Socket::Done)
    {
        cout << "Connection error!" << endl;
        return 1;
    }
    char buffer[251] = { 0 };
    size_t received;
    char req[] = "GET / HTTP/1.1\r\n\r\n";
    sock.send(req, strlen(req));
    sock.receive(buffer, 250, received);
    cout << "buffer: " << buffer << endl;
    cout << "local port: " << sock.getLocalPort() << endl;
    cout << "remote address: " << sock.getRemoteAddress() << endl;
    cout << "remote port: " << sock.getRemotePort() << endl;
    return 0;

But it's run into an error. If I put "www.google.com" - works fine.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32451
    • View Profile
    • SFML's website
    • Email
Re: SFML sf::IpAddress 2019
« Reply #1 on: December 16, 2019, 07:57:00 am »
Quote
Is it still impossible to work with IPv6 via SFML?
Yes, this is even clearly written in the documentation ;)
Laurent Gomila - SFML developer

innoox

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: SFML sf::IpAddress 2019
« Reply #2 on: December 16, 2019, 05:18:10 pm »
Quote
Is it still impossible to work with IPv6 via SFML?
Yes, this is even clearly written in the documentation ;)

I'm sorry, but all I found is:
Quote
Note that sf::IpAddress currently doesn't support IPv6 nor other types of network addresses.
https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1IpAddress.php
Can I ask you a link to the documentation of IPv6, please?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 9593
    • View Profile
    • development blog
    • Email
Re: SFML sf::IpAddress 2019
« Reply #3 on: December 16, 2019, 05:22:52 pm »
That's the documentation Laurent was referring to and the statement is still true, SFML still doesn't support IPv6.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
——————————————————————
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/

innoox

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: SFML sf::IpAddress 2019
« Reply #4 on: December 16, 2019, 06:50:33 pm »
That's the documentation Laurent was referring to and the statement is still true, SFML still doesn't support IPv6.
Oh, yes I see. Wrong understand :D
Thanks for the fast answer.

 

anything