X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05583a26e177257410822cf09447e5047a506f7c..08670ea85abf4b4946a9ce64971b591d7b1ee30b:/src/osx/core/sockosx.cpp diff --git a/src/osx/core/sockosx.cpp b/src/osx/core/sockosx.cpp index d19c7ef901..847b8ac12d 100644 --- a/src/osx/core/sockosx.cpp +++ b/src/osx/core/sockosx.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: osx/core/gsockosx.cpp +// Name: src/osx/core/gsockosx.cpp // Purpose: wxSocketImpl implementation for OS X // Authors: Brian Victor, Vadim Zeitlin // Created: February 2002 @@ -16,6 +16,9 @@ #include "wx/private/socket.h" #include "wx/unix/private/sockunix.h" #include "wx/apptrait.h" +#include "wx/link.h" + +#include "wx/osx/core/cfstring.h" // for wxMacWakeUp() only #include @@ -138,7 +141,7 @@ private: // KH: If data is non-NULL, the connect failed, do not call Detected_Write, // which will only end up creating a spurious connect event because the // call to getsocketopt SO_ERROR inexplicably returns no error. - // The change in behavior cannot be traced to any particular commit or + // The change in behaviour cannot be traced to any particular commit or // timeframe so I'm not sure what to think, but after so many hours, // this seems to address the issue and it's time to move on. if (data == NULL) @@ -156,6 +159,13 @@ private: default: wxFAIL_MSG( "unexpected socket callback" ); } + + // receiving a socket event does _not_ make ReceiveNextEvent() (or the + // equivalent NSApp:nextEventMatchingMask:untilDate:inMode:dequeue) + // return control, i.e. apparently it doesn't count as a real event, so + // we need to generate a wake up to return control to the code waiting + // for something to happen and process this socket event + wxMacWakeUp(); } CFSocketRef m_socket; @@ -276,4 +286,7 @@ static struct OSXManagerSetter } } gs_OSXManagerSetter; +// see the relative linker macro in socket.cpp +wxFORCE_LINK_THIS_MODULE(osxsocket) + #endif // wxUSE_SOCKETS