X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0c133e13b36a923c65f94499554e432bc3a0daa..38534f596974042130716a26276e9564b0b72295:/include/wx/private/socket.h diff --git a/include/wx/private/socket.h b/include/wx/private/socket.h index 936eb13b5e..297c40d176 100644 --- a/include/wx/private/socket.h +++ b/include/wx/private/socket.h @@ -51,7 +51,7 @@ having been defined in sys/types.h" when winsock.h is included later and doesn't seem to be necessary anyhow. It's not needed under Mac neither. */ -#if !defined(__WXMAC__) && !defined(__CYGWIN__) && !defined(__WXWINCE__) +#if !defined(__WXMAC__) && !defined(__WXMSW__) && !defined(__WXWINCE__) #include #endif @@ -61,7 +61,7 @@ // include the header defining timeval: under Windows this struct is used only // with sockets so we need to include winsock.h which we do via windows.h -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #else #include // for timeval @@ -79,10 +79,6 @@ // define some symbols which winsock.h defines but traditional BSD headers // don't -#ifndef __WXMSW__ - #define SOCKET int -#endif - #ifndef INVALID_SOCKET #define INVALID_SOCKET (-1) #endif @@ -139,6 +135,9 @@ public: virtual void OnExit() = 0; + // create the socket implementation object matching this manager + virtual wxSocketImpl *CreateSocket(wxSocketBase& wxsocket) = 0; + // these functions enable or disable monitoring of the given socket for the // specified events inside the currently running event loop (but notice // that both BSD and Winsock implementations actually use socket->m_server @@ -167,16 +166,12 @@ private: Base class for all socket implementations providing functionality common to BSD and Winsock sockets. - Objects of this class are not created directly but only via its static - Create() method which is implemented in port-specific code. + Objects of this class are not created directly but only via the factory + function wxSocketManager::CreateSocket(). */ class wxSocketImpl { public: - // static factory function: creates the low-level socket associated with - // the given wxSocket (and inherits its attributes such as timeout) - static wxSocketImpl *Create(wxSocketBase& wxsocket); - virtual ~wxSocketImpl(); // set various socket properties: all of those can only be called before @@ -294,7 +289,7 @@ public: // TODO: make these fields protected and provide accessors for those of // them that wxSocketBase really needs //protected: - SOCKET m_fd; + wxSOCKET_T m_fd; int m_initialRecvBufferSize; int m_initialSendBufferSize; @@ -368,7 +363,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxSocketImpl); }; -#if defined(__WXMSW__) +#if defined(__WINDOWS__) #include "wx/msw/private/sockmsw.h" #else #include "wx/unix/private/sockunix.h"