#pragma interface
#endif
+#include "wx/defs.h"
+
#if wxUSE_SOCKETS
-#include <wx/object.h>
-#include <wx/list.h>
-#include <wx/socket.h>
-#include <wx/thread.h>
+#include "wx/object.h"
+#include "wx/list.h"
+#include "wx/socket.h"
+#include "wx/thread.h"
// Socket state
class SocketState
};
class wxSocketInternal;
+
+#if wxUSE_THREADS
class SocketWaiter: public wxThread {
public:
SocketWaiter(wxSocketBase *socket, wxSocketInternal *internal);
int m_fd;
};
-class SocketRequester: public wxThread {
+class SocketRequester
+#if wxUSE_THREADS
+ : public wxThread
+#endif
+ {
public:
SocketRequester(wxSocketBase *socket, wxSocketInternal *internal);
~SocketRequester();
wxSocketInternal *m_internal;
int m_fd;
};
+#endif
+ // wxUSE_THREADS
class wxSocketInternal {
public:
void ReleaseFD();
int GetFD() { return m_fd; }
+ void SetFD(int fd) { m_fd = fd; }
- void InitializeSocket();
- void FinalizeSocket();
- void PauseSocket();
- void ResumeSocket();
- void EnableWaiter();
- void DisableWaiter();
+ void ResumeWaiter();
+ void StopWaiter();
+ void ResumeRequester();
+ void StopRequester();
void QueueRequest(SockRequest *request, bool async);
void WaitForEnd(SockRequest *request);
SockRequest *WaitForReq();
void EndRequest(SockRequest *req);
public:
- wxMutex m_socket_locker, m_fd_locker, m_request_locker;
- wxCondition m_socket_cond;
wxSocketBase *m_socket;
+#if wxUSE_THREADS
+ wxMutex m_socket_locker, m_fd_locker, m_request_locker, m_end_requester;
+ wxCondition m_socket_cond;
SocketWaiter *m_thread_waiter;
+#endif
SocketRequester *m_thread_requester;
wxList m_requests;
int m_fd;
+ bool m_invalid_requester;
};
#endif