#include "wx/socket.h"
-#if defined(__WXMSW__)
-#define PROCESS_EVENTS() wxYield()
+#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMOTIF__)
+ #define PROCESS_EVENTS() wxYield()
#elif defined(__WXGTK__)
-#include <gtk/gtk.h>
-#define PROCESS_EVENTS() gtk_main_iteration()
-#endif
+ #include <gtk/gtk.h>
+ #define PROCESS_EVENTS() gtk_main_iteration()
+#endif
// --------------------------------------------------------------
public:
bool notify_state;
GSocketEventFlags evt_notify_state;
- wxSocketBase::wxSockFlags socket_flags;
+ wxSockFlags socket_flags;
wxSocketBase::wxSockCbk c_callback;
char *c_callback_data;
// wxSocketBase ctor and dtor
// --------------------------------------------------------------
-wxSocketBase::wxSocketBase(wxSocketBase::wxSockFlags _flags,
- wxSocketBase::wxSockType _type) :
+wxSocketBase::wxSocketBase(wxSockFlags _flags, wxSockType _type) :
wxEvtHandler(),
m_socket(NULL), m_id(-1),
m_flags(_flags), m_type(_type),
DoDefer();
}
- // Wait for buffer completion.
+ // Wait for buffer completion.
while (m_defer_buffer != NULL)
PROCESS_EVENTS();
// If the socket is not connected, or we have got the whole
// needed buffer, return immedately
- if (!m_connected || !m_socket || !nbytes)
+ if (!m_connected || !m_socket || !nbytes)
return total;
// Possible combinations (they are checked in this order)
// NOWAIT
// SPEED | WAITALL
- // SPEED
+ // SPEED
// WAITALL
// NONE
//
if (sig != 0xfeeddead)
{
- wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
+ wxLogMessage(wxT("Warning: invalid signature returned to ReadMsg"));
goto exit;
}
if (sig != 0xdeadfeed)
{
- //wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
+ //wxLogMessage(wxT("Warning: invalid signature returned to ReadMsg"));
goto exit;
}
DoDefer();
}
- // Wait for buffer completion.
+ // Wait for buffer completion.
while (m_defer_buffer != NULL)
PROCESS_EVENTS();
// Possible combinations (they are checked in this order)
// NOWAIT
// SPEED | WAITALL
- // SPEED
+ // SPEED
// WAITALL
// NONE
//
// TODO: TriggerRead
return *this;
-
+
#undef MAX_BUFSIZE
}
{
m_flags = _flags;
}
-
+
// --------------------------------------------------------------
// wxSocketBase callback management
// --------------------------------------------------------------