Do wait for connection in the server socket.
The code returned immediately from wxSocketBase::DoWait() if it wasn't connected but it only made sense for the client sockets, not server ones which could be calling this function precisely in order to wait until a connection is made. Also added a test for this bug in the sockets/server sample. Closes #11107. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user