// wxSocket headers (generic)
// ---------------------------------------------------------------------------
#ifdef WXPREC
// wxSocket headers (generic)
// ---------------------------------------------------------------------------
#ifdef WXPREC
class WXDLLEXPORT wxSocketEvent;
class WXDLLEXPORT wxSocketBase : public wxEvtHandler
{
DECLARE_CLASS(wxSocketBase)
public:
class WXDLLEXPORT wxSocketEvent;
class WXDLLEXPORT wxSocketBase : public wxEvtHandler
{
DECLARE_CLASS(wxSocketBase)
public:
- enum wxSockFlags { NONE=0, NOWAIT=1, WAITALL=2, SPEED=4 };
+ enum { NONE=0, NOWAIT=1, WAITALL=2, SPEED=4 };
+ typedef int wxSockFlags;
- enum wxSockType { SOCK_CLIENT, SOCK_SERVER, SOCK_INTERNAL, SOCK_UNINIT };
+ enum wxSockType { SOCK_CLIENT, SOCK_SERVER, SOCK_INTERNAL, SOCK_UNINIT };
inline size_t LastCount() const { return m_lcount; }
inline GSocketError LastError() const { return GSocket_GetError(m_socket); }
inline wxSockType GetType() const { return m_type; }
inline size_t LastCount() const { return m_lcount; }
inline GSocketError LastError() const { return GSocket_GetError(m_socket); }
inline wxSockType GetType() const { return m_type; }
void SetFlags(wxSockFlags _flags);
wxSockFlags GetFlags() const;
inline void SetTimeout(unsigned long sec) { m_timeout = sec; }
void SetFlags(wxSockFlags _flags);
wxSockFlags GetFlags() const;
inline void SetTimeout(unsigned long sec) { m_timeout = sec; }
bool WaitForRead(long seconds = -1, long microseconds = 0);
bool WaitForWrite(long seconds = -1, long microseconds = 0);
bool WaitForLost(long seconds = -1, long microseconds = 0);
bool WaitForRead(long seconds = -1, long microseconds = 0);
bool WaitForWrite(long seconds = -1, long microseconds = 0);
bool WaitForLost(long seconds = -1, long microseconds = 0);
// Method called when it happens something on the socket
void SetNotify(GSocketEventFlags flags);
virtual void OnRequest(GSocketEvent req_evt);
// Method called when it happens something on the socket
void SetNotify(GSocketEventFlags flags);
virtual void OnRequest(GSocketEvent req_evt);
bool _Wait(long seconds, long microseconds, int type);
int DeferRead(char *buffer, size_t nbytes);
int DeferWrite(const char *buffer, size_t nbytes);
void DoDefer(GSocketEvent evt);
bool _Wait(long seconds, long microseconds, int type);
int DeferRead(char *buffer, size_t nbytes);
int DeferWrite(const char *buffer, size_t nbytes);
void DoDefer(GSocketEvent evt);