X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c32066b58849e52e4d76e30982414d9f4daae6a..9ef4a31e643ce01bef16b37f10be125df0c2ab0f:/include/wx/socket.h diff --git a/include/wx/socket.h b/include/wx/socket.h index b81f609ec4..ebd5a5ecd6 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -80,6 +80,9 @@ class WXDLLEXPORT wxSocketHandler; class WXDLLEXPORT wxSocketBase : public wxEvtHandler { DECLARE_CLASS(wxSocketBase) +#ifdef __WXMAC__ +friend void wxMacSocketOnRequestProc(void *refcon , short event) ; +#endif public: enum wxSockFlags { NONE=0, NOWAIT=1, WAITALL=2, SPEED=4 }; @@ -208,7 +211,15 @@ protected: friend class wxSocketServer; friend class wxSocketHandler; +#ifdef __SALFORDC__ +public: +#endif + wxSocketBase(wxSockFlags flags, wxSockType type); + +#ifdef __SALFORDC__ +protected: +#endif bool _Wait(long seconds, long microseconds, int type); @@ -259,7 +270,7 @@ public: virtual bool Connect(wxSockAddress& addr_man, bool wait = TRUE); - bool WaitOnConnect(long seconds = -1); + bool WaitOnConnect(long seconds = -1, long microseconds = 0); virtual void OnRequest(wxRequestEvent flags); }; @@ -270,7 +281,6 @@ class WXDLLEXPORT wxSocketHandler : public wxObject { DECLARE_CLASS(wxSocketHandler) protected: - static wxSocketHandler *master; #if defined(__WINDOWS__) wxList *smsg_list; struct wxSockHandlerInternal *internal; @@ -280,6 +290,7 @@ protected: public: enum SockStatus { SOCK_NONE, SOCK_DATA, SOCK_CONNECT, SOCK_DISCONNECT, SOCK_ERROR }; + static wxSocketHandler *master; wxSocketHandler(); virtual ~wxSocketHandler(); @@ -303,8 +314,7 @@ public: (wxSocketBase::wxSockFlags flags = wxSocketBase::NONE); // Create or reuse a socket handler - static wxSocketHandler& Master() - { return *((master) ? (master) : (master = new wxSocketHandler())); } + static wxSocketHandler& Master() { return *master; } #if defined(WXSOCK_INTERNAL) && defined(__WINDOWS__) @@ -332,6 +342,8 @@ typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); #define wxEVT_SOCKET wxEVT_FIRST+301 -#define EVT_SOCKET(id, func) { wxEVT_SOCKET, id, 0, (wxObjectEventFunction) (wxEventFunction) (wxSocketEventFunction) & func }, +#define EVT_SOCKET(id, func) { wxEVT_SOCKET, id, 0, \ + (wxObjectEventFunction) (wxEventFunction) (wxSocketEventFunction) & func, \ + (wxObject *) NULL }, #endif