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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - innoox

Pages: [1]
1
Network / 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.

Pages: [1]
anything