]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/sockosx.cpp
set default resolutions in case of errors
[wxWidgets.git] / src / osx / core / sockosx.cpp
index d19c7ef9016e40213cc7e888f366c6b9b0143273..08711a0980d0fe1f6d5885d0bc47a7baa3904927 100644 (file)
@@ -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 <CoreFoundation/CoreFoundation.h>
 
@@ -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