From 6e8ae0b64654a5e6c9a676b765acd9db049e13b9 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 25 May 2016 15:34:19 +0000 Subject: [PATCH] Ignore connection refused errors on UDP sockets In Qt 5.6 the optional connection refused error from a UDP socket that is written to where no server is listening is signalled. This error only happens when the o/s can tell that no one is listening i.e. on the local host loopback address. We can safely ignore these errors as we do not care if anyone is listening or not. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6701 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- MessageClient.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MessageClient.cpp b/MessageClient.cpp index 54b64a9c8..63c868ad7 100644 --- a/MessageClient.cpp +++ b/MessageClient.cpp @@ -281,9 +281,13 @@ MessageClient::MessageClient (QString const& id, QString const& server, port_typ , [this] (impl::SocketError e) { #if defined (Q_OS_WIN) && QT_VERSION >= 0x050500 - if (e != impl::NetworkError) // take this out when Qt 5.5 - // stops doing this - // spuriously + 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 #else Q_UNUSED (e); #endif