X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3bf7524f394af039efe196a186f7969cbabcc19..85f138db83939ce7c59a942aaecca7fa98168db3:/include/wx/socket.h?ds=sidebyside diff --git a/include/wx/socket.h b/include/wx/socket.h index ee5df5f03e..85394cdd18 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(); @@ -151,6 +146,10 @@ public: void SetFlags(wxSocketFlags flags); void SetTimeout(long seconds); + bool GetOption(int level, int optname, void *optval, int *optlen); + bool SetOption(int level, int optname, const void *optval, int optlen); + inline wxUint32 GetLastIOSize() const { return m_lcount; }; + // event handling void *GetClientData() const { return m_clientData; } void SetClientData(void *data) { m_clientData = data; } @@ -323,10 +322,8 @@ typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); #define EVT_SOCKET(id, func) \ DECLARE_EVENT_TABLE_ENTRY( wxEVT_SOCKET, id, -1, \ - (wxObjectEventFunction) \ - (wxEventFunction) \ - (wxSocketEventFunction) & func, \ - (wxObject *) NULL ), + (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSocketEventFunction, & func ), \ + (wxObject *) NULL ), #endif