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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user