0

We are exploring poco (pocoproject.org) library's HTTP server example. On windows it runs well but on FreeBSD issues "Address family not supported". On FreeBSD we used dynamic linking of installed via pkg poco-1.7.8

Source of this sample: https://github.com/toggl/toggldesktop/blob/master/third_party/poco/Net/samples/HTTPFormServer/src/HTTPFormServer.cpp

Any suggestions how we can fix it?

----- Update:

Original sample uses ipv4.

Same issue when I create ipv6 socket as follows:

        Poco::Net::SocketAddress addr("[fe80::a00:27ff:feb7:6b1a]:9980");

        if (addr.family() == static_cast<Poco::Net::IPAddress::Family>(Poco::Net::Impl::IPAddressImpl::IPv6)) {
            std::cout << "Addr: ipv6 " << std::endl;
        }
        else if (addr.family() == static_cast<Poco::Net::IPAddress::Family>(Poco::Net::Impl::IPAddressImpl::IPv4)) {
            std::cout << "Addr: ipv4 " << std::endl;
        }
        else {
            std::cout << "Addr: something else (err)." << std::endl;
        }

        // set-up a server socket
        ServerSocket svs(addr);

Output

    Addr: ipv6
    Net Exception: Address family not supported
Victor
  • 181
  • 2
  • 12

1 Answers1

0

I don't know anything about poco, but the error message hints that it is an IPv6 issue.

Possible solutions:

  • Disable IPv6 on FreeBSD
  • Make your program IPv6 aware

See also this related question

arved
  • 4,401
  • 4
  • 30
  • 53