X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a50fb9c08396a37521dffd48bbf346f83fc49f3c..29ea4a290850e9ae79c258774fa22153a951ff7f:/include/wx/sckint.h diff --git a/include/wx/sckint.h b/include/wx/sckint.h index 8d90c4b133..103595f5f6 100644 --- a/include/wx/sckint.h +++ b/include/wx/sckint.h @@ -15,12 +15,14 @@ #pragma interface #endif +#include "wx/defs.h" + #if wxUSE_SOCKETS -#include -#include -#include -#include +#include "wx/object.h" +#include "wx/list.h" +#include "wx/socket.h" +#include "wx/thread.h" // Socket state class SocketState @@ -81,8 +83,13 @@ class SocketWaiter: public wxThread { wxSocketInternal *m_internal; int m_fd; }; +#endif -class SocketRequester: public wxThread { +class SocketRequester +#if wxUSE_THREADS + : public wxThread +#endif + { public: SocketRequester(wxSocketBase *socket, wxSocketInternal *internal); ~SocketRequester(); @@ -93,17 +100,17 @@ class SocketRequester: public wxThread { bool WaitFor(wxSocketBase::wxRequestNotify req, int millisec); +#if wxUSE_THREADS // Thread Entry point // --- virtual void *Entry(); +#endif public: wxSocketBase *m_socket; wxSocketInternal *m_internal; int m_fd; }; -#endif - // wxUSE_THREADS class wxSocketInternal { public: @@ -118,6 +125,7 @@ class wxSocketInternal { void ReleaseFD(); int GetFD() { return m_fd; } + void SetFD(int fd) { m_fd = fd; } void ResumeWaiter(); void StopWaiter(); @@ -127,6 +135,7 @@ class wxSocketInternal { void QueueRequest(SockRequest *request, bool async); void WaitForEnd(SockRequest *request); + // Used by SocketRequester SockRequest *WaitForReq(); void EndRequest(SockRequest *req); public: @@ -135,8 +144,8 @@ class wxSocketInternal { wxMutex m_socket_locker, m_fd_locker, m_request_locker, m_end_requester; wxCondition m_socket_cond; SocketWaiter *m_thread_waiter; - SocketRequester *m_thread_requester; #endif + SocketRequester *m_thread_requester; wxList m_requests; int m_fd; bool m_invalid_requester;