From a24f402655c6eb9e81b76bfc1fe3e8cd27b5115e Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 26 Jun 2020 17:57:21 +0100 Subject: [PATCH] Skipping of connection refused net errors on Windows with Qt 5.15 Apparently this is still required. --- Network/MessageClient.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Network/MessageClient.cpp b/Network/MessageClient.cpp index d33b2a636..dae238b23 100644 --- a/Network/MessageClient.cpp +++ b/Network/MessageClient.cpp @@ -425,28 +425,23 @@ MessageClient::MessageClient (QString const& id, QString const& version, QString { #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) connect (&*m_, static_cast (&impl::error) - , [this] (impl::SocketError e) - { -#if defined (Q_OS_WIN) - if (e != impl::NetworkError // take this out when Qt 5.5 - // stops doing this - // spuriously - && e != impl::ConnectionRefusedError) // not - // interested - // in this with - // UDP socket + , [this] (impl::SocketError e) { #else - Q_UNUSED (e); + connect (&*m_, &impl::errorOccurred, [this] (impl::SocketError e) { +#endif +#if defined (Q_OS_WIN) + // take this out when Qt 5.5 stops doing this spuriously + if (e != impl::NetworkError + // not interested in this with UDP socket + && e != impl::ConnectionRefusedError) +#else + Q_UNUSED (e); #endif { Q_EMIT error (m_->errorString ()); } }); -#else - connect (&*m_, &impl::errorOccurred, [this] (impl::SocketError) { - Q_EMIT error (m_->errorString ()); - }); -#endif + set_server (server); }