X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3270038fb4d2a8cb1634a041ce123116de7e9618..e331a94e90f76e19823df13772f87541fc6ead20:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 95778390a5..7e1aafd4a2 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -1355,8 +1355,10 @@ wxSocketBase::DoWait(long timeout, wxSocketEventFlags flags) { wxCHECK_MSG( m_impl, -1, "can't wait on invalid socket" ); - // we're never going to become ready if we're not connected (any more) - if ( !m_connected && !m_establishing ) + // 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 ) return -1; // This can be set to true from Interrupt() to exit this function a.s.a.p.