From 1632883f9ae83cb0f75b82432ab1f8ca7cfae451 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 23 Jul 2010 23:33:40 +0000 Subject: [PATCH] Fix waiting for IO on UDP sockets. We mistakenly considered them closed because they were not connected but UDP sockets don't have to be -- unlike TCP ones. Closes #11384. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/socket.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 182cf510c6..c0c35df4e2 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -1372,10 +1372,11 @@ wxSocketBase::DoWait(long timeout, wxSocketEventFlags flags) { wxCHECK_MSG( m_impl, -1, "can't wait on invalid socket" ); - // we're never going to become ready in a client if we're not connected any - // more (OTOH a server can call this to precisely wait for a connection so - // do wait for it in this case) - if ( !m_impl->IsServer() && !m_connected && !m_establishing ) + // we're never going to become ready in a TCP client if we're not connected + // any more (OTOH a server can call this to precisely wait for a connection + // so do wait for it in this case and UDP client is never "connected") + if ( !m_impl->IsServer() && + m_impl->m_stream && !m_connected && !m_establishing ) return -1; // This can be set to true from Interrupt() to exit this function a.s.a.p. -- 2.45.2