#include "wx/utils.h"
#include "wx/module.h"
#include "wx/log.h"
+#include "wx/intl.h"
#include <stdlib.h>
#include <string.h>
#include "wx/socket.h"
-#if defined(__WXMSW__) || defined(__WXPM__)
-#define PROCESS_EVENTS() wxYield()
+#if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMOTIF__) || defined(__WXMAC__)
+ #define PROCESS_EVENTS() wxYield()
#elif defined(__WXGTK__)
-#include <gtk/gtk.h>
-#define PROCESS_EVENTS() gtk_main_iteration()
+ #include <gtk/gtk.h>
+ #define PROCESS_EVENTS() gtk_main_iteration()
#endif
// --------------------------------------------------------------
// ClassInfos
// --------------------------------------------------------------
-#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxSocketBase, wxObject)
IMPLEMENT_CLASS(wxSocketServer, wxSocketBase)
IMPLEMENT_CLASS(wxSocketClient, wxSocketBase)
IMPLEMENT_DYNAMIC_CLASS(wxSocketEvent, wxEvent)
-#endif
class wxSocketState : public wxObject
{
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),
if (sig != 0xfeeddead)
{
- wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
+ wxLogWarning( _("TCP: 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;
}
m_defer_timer = NULL;
m_defering = NO_DEFER;
- wxString s;
- s.Printf("Saliendo de DeferWrite: total %d bytes", nbytes-m_defer_nbytes);
+ //wxString s;
+ //s.Printf(wxT("Saliendo de DeferWrite: total %d bytes"), nbytes-m_defer_nbytes);
//wxLogMessage(s);
return nbytes-m_defer_nbytes;
m_timeout = seconds;
if (m_socket)
- GSocket_SetTimeout(m_socket, m_timeout);
+ GSocket_SetTimeout(m_socket, m_timeout * 1000);
}
// --------------------------------------------------------------
return;
}
- GSocket_SetTimeout(m_socket, m_timeout);
+ GSocket_SetTimeout(m_socket, m_timeout * 1000);
GSocket_SetCallback(m_socket, GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG |
GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG,
wx_socket_callback, (char *)this);
sock.m_socket = child_socket;
sock.m_connected = TRUE;
- GSocket_SetTimeout(sock.m_socket, sock.m_timeout);
+ GSocket_SetTimeout(sock.m_socket, sock.m_timeout * 1000);
GSocket_SetCallback(sock.m_socket, GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG |
GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG,
wx_socket_callback, (char *)&sock);
if (!m_socket)
return FALSE;
- GSocket_SetTimeout(m_socket, m_timeout);
+ GSocket_SetTimeout(m_socket, m_timeout * 1000);
GSocket_SetCallback(m_socket, GSOCK_INPUT_FLAG | GSOCK_OUTPUT_FLAG |
GSOCK_LOST_FLAG | GSOCK_CONNECTION_FLAG,
wx_socket_callback, (char *)this);