X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bfa7bf7d6b75e4fa31db205cf0b339c28ea6d090..b4e0b521e0878a495c570af3d68b40c82b4a92b3:/include/wx/socket.h diff --git a/include/wx/socket.h b/include/wx/socket.h index 7b153c09d9..e8029c5adc 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -24,13 +24,7 @@ // wxSocket headers // --------------------------------------------------------------------------- -#ifdef WXPREC - #include "wx/wxprec.h" -#else - #include "wx/event.h" - #include "wx/string.h" -#endif - +#include "wx/event.h" #include "wx/sckaddr.h" #include "wx/gsocket.h" #include "wx/list.h" @@ -80,7 +74,8 @@ enum wxSOCKET_NONE = 0, wxSOCKET_NOWAIT = 1, wxSOCKET_WAITALL = 2, - wxSOCKET_BLOCK = 4 + wxSOCKET_BLOCK = 4, + wxSOCKET_REUSEADDR = 8 }; enum wxSocketType @@ -123,7 +118,7 @@ public: inline bool IsData() { return WaitForRead(0, 0); }; inline bool IsDisconnected() const { return !IsConnected(); }; inline wxUint32 LastCount() const { return m_lcount; } - inline wxSocketError LastError() const { return (wxSocketError)GSocket_GetError(m_socket); } + inline wxSocketError LastError() const { return (wxSocketError)m_socket->GetError(); } void SaveState(); void RestoreState(); @@ -141,7 +136,7 @@ public: wxSocketBase& Write(const void *buffer, wxUint32 nbytes); wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes); - void InterruptWait() { m_interrupt = TRUE; }; + void InterruptWait() { m_interrupt = true; }; bool Wait(long seconds = -1, long milliseconds = 0); bool WaitForRead(long seconds = -1, long milliseconds = 0); bool WaitForWrite(long seconds = -1, long milliseconds = 0); @@ -158,7 +153,7 @@ public: // event handling void *GetClientData() const { return m_clientData; } void SetClientData(void *data) { m_clientData = data; } - void SetEventHandler(wxEvtHandler& handler, int id = -1); + void SetEventHandler(wxEvtHandler& handler, int id = wxID_ANY); void SetNotify(wxSocketEventFlags flags); void Notify(bool notify); @@ -241,8 +236,8 @@ class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase public: wxSocketServer(wxSockAddress& addr, wxSocketFlags flags = wxSOCKET_NONE); - wxSocketBase* Accept(bool wait = TRUE); - bool AcceptWith(wxSocketBase& socket, bool wait = TRUE); + wxSocketBase* Accept(bool wait = true); + bool AcceptWith(wxSocketBase& socket, bool wait = true); bool WaitForAccept(long seconds = -1, long milliseconds = 0); @@ -262,7 +257,7 @@ public: wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE); virtual ~wxSocketClient(); - virtual bool Connect(wxSockAddress& addr, bool wait = TRUE); + virtual bool Connect(wxSockAddress& addr, bool wait = true); bool WaitOnConnect(long seconds = -1, long milliseconds = 0); @@ -326,7 +321,7 @@ public: typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); #define EVT_SOCKET(id, func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, -1, \ + DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, wxID_ANY, \ (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSocketEventFunction, & func ), \ (wxObject *) NULL ),