// what to do within waits: we have 2 cases: from the main thread itself we
// have to call wxYield() to let the events (including the GUI events and the
-// low-level (not wxWindows) events from GSocket) be processed. From another
+// low-level (not wxWidgets) events from GSocket) be processed. From another
// thread it is enough to just call wxThread::Yield() which will give away the
// rest of our time slice: the explanation is that the events will be processed
// by the main thread anyhow, without calling wxYield(), but we don't want to
else
timeout = m_timeout * 1000;
+#if !defined(wxUSE_GUI) || !wxUSE_GUI
+ GSocket_SetTimeout(m_socket, timeout);
+#endif
+
// Wait in an active polling loop.
//
// NOTE: We duplicate some of the code in OnRequest, but this doesn't