Notify(false);
// Schedule this object for deletion instead of destroying it right now if
- // possible as we may have other events pending for it
- if ( wxTheApp )
+ // it can have other events pending for it and we have a way to do it.
+ //
+ // Notice that sockets used in other threads won't have any events for them
+ // and we shouldn't use delayed destruction mechanism for them as it's not
+ // MT-safe.
+ if ( wxIsMainThread() && wxTheApp )
{
wxTheApp->ScheduleForDestruction(this);
}
return;
}
- wxLogTrace( wxTRACE_Socket, wxT("wxSocketServer on fd %d"), m_impl->m_fd );
+ // Notice that we need a cast as SOCKET is 64 bit under Win64 and that the
+ // cast is safe because a SOCKET is a handle and so limited to 32 (or,
+ // actually, even 24) bit values anyhow.
+ wxLogTrace( wxTRACE_Socket, wxT("wxSocketServer on fd %u"),
+ static_cast<unsigned>(m_impl->m_fd) );
}
// --------------------------------------------------------------------------
#endif
// same for ManagerSetter in the MSW file
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxFORCE_LINK_MODULE( mswsocket )
#endif