]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix waiting for IO on UDP sockets.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Jul 2010 23:33:40 +0000 (23:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 23 Jul 2010 23:33:40 +0000 (23:33 +0000)
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

index 182cf510c6785979656077e04ef40684f872cc77..c0c35df4e2e16bbfcf1e80a2cd0b6496a663a675 100644 (file)
@@ -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.