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
This commit is contained in:
Vadim Zeitlin
2010-07-23 23:33:40 +00:00
parent 9741fd45f7
commit 1632883f9a

View File

@@ -1372,10 +1372,11 @@ wxSocketBase::DoWait(long timeout, wxSocketEventFlags flags)
{ {
wxCHECK_MSG( m_impl, -1, "can't wait on invalid socket" ); 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 // we're never going to become ready in a TCP client if we're not connected
// more (OTOH a server can call this to precisely wait for a connection so // any more (OTOH a server can call this to precisely wait for a connection
// do wait for it in this case) // so do wait for it in this case and UDP client is never "connected")
if ( !m_impl->IsServer() && !m_connected && !m_establishing ) if ( !m_impl->IsServer() &&
m_impl->m_stream && !m_connected && !m_establishing )
return -1; return -1;
// This can be set to true from Interrupt() to exit this function a.s.a.p. // This can be set to true from Interrupt() to exit this function a.s.a.p.