]> Some of my projects - anidbudpclient.git/commitdiff
Ensure the client only connects with IPv4.
authorAPTX <marek321@gmail.com>
Sun, 25 Oct 2015 13:57:54 +0000 (14:57 +0100)
committerAPTX <marek321@gmail.com>
Sun, 25 Oct 2015 13:57:54 +0000 (14:57 +0100)
AniDB does not support IPv6.

client.cpp

index 7ebcdd4ce9626fa08e8a417dd67b4bb753409d7c..52fa317b4caf2a59bea06a70cf1df212f668f72e 100644 (file)
@@ -295,7 +295,11 @@ qDebug() << "Entering Connecting State";
        qDebug() << "Host address is:" << m_hostAddress;
        if (!m_hostAddress.isNull())
        {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+               if (socket->bind(QHostAddress::AnyIPv4, m_localPort))
+#else
                if (socket->bind(QHostAddress::Any, m_localPort))
+#endif
                {
 #ifdef ANIDBUDPCLIENT_CLIENT_MISC_DEBUG
 qDebug() << "Successful connection";