]> git.saurik.com Git - wxWidgets.git/commitdiff
remove wxSocketManager::CreateSocket() function, we don't need to have different...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 28 Nov 2008 15:06:50 +0000 (15:06 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 28 Nov 2008 15:06:50 +0000 (15:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/private/socket.h
include/wx/unix/private/sockunix.h
src/common/socket.cpp
src/msw/gsocket.cpp
src/unix/sockunix.cpp

index 22d99911e01af4c5721242fd8d6c3b321b088cce..e1c2f6ad254dce0867056b77e6d656222a0ced18 100644 (file)
@@ -21,7 +21,7 @@
 
     - wxSocketImpl is actually just an abstract base class having only code
       common to all platforms, the concrete implementation classes derive from
-      it and are created by wxSocketManager::CreateSocket().
+      it and are created by wxSocketImpl::Create().
 
     - Some socket operations have different implementations in console-mode and
       GUI applications. wxSocketManager class exists to abstract this in such
@@ -153,14 +153,6 @@ public:
     virtual void OnExit() = 0;
 
 
-    // create a concrete socket implementation associated with the given
-    // wxSocket object
-    //
-    // the returned object must be deleted by the caller
-    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
@@ -185,7 +177,7 @@ private:
     BSD and Winsock sockets.
 
     Objects of this class are not created directly but only via its static
-    Create() method which in turn forwards to wxSocketManager::CreateSocket().
+    Create() method which is implemented in port-specific code.
  */
 class wxSocketImpl
 {
index dd82c31045b934e318ba083d4432392149bc0af8..dd83004505b230fb30f91a9aa1a48f6762fa64fe 100644 (file)
@@ -141,12 +141,6 @@ public:
     virtual bool OnInit() { return true; }
     virtual void OnExit() { }
 
-    // allocate/free the storage we need
-    virtual wxSocketImpl *CreateSocket(wxSocketBase& wxsocket)
-    {
-        return new wxSocketImplUnix(wxsocket);
-    }
-
 protected:
     // identifies either input or output direction
     //
index 541749394e6312b058fecf892314f01118f3d5eb..d17ce8f2ed1cf7afe5e1cddc3777173d2cccaa1e 100644 (file)
@@ -160,13 +160,6 @@ void wxSocketManager::Init()
 // wxSocketImpl
 // ==========================================================================
 
-/* static */
-wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket)
-{
-    wxSocketManager * const manager = wxSocketManager::Get();
-    return manager ? manager->CreateSocket(wxsocket) : NULL;
-}
-
 wxSocketImpl::wxSocketImpl(wxSocketBase& wxsocket)
     : m_wxsocket(&wxsocket)
 {
index 0e8bbd39dfed50f8928231ef4bf20ba1a0a9f2ed..a74fb08bba559fabba80f31808ad494c6e9d5630 100644 (file)
@@ -77,6 +77,12 @@ wxFORCE_LINK_MODULE(gsockmsw)
 
 #include "wx/private/socket.h"
 
+/* static */
+wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket)
+{
+    return new wxSocketImplMSW(wxsocket);
+}
+
 void wxSocketImplMSW::DoClose()
 {
     wxSocketManager::Get()->
index 3fd9875c8bfc9478bd04a6d25f9fad42266a60bd..31c04877c36fbac90c4427a5ff184dd933c279fe 100644 (file)
@@ -431,6 +431,12 @@ struct servent *wxGetservbyname_r(const char *port, const char *protocol,
 #  define SOCKET_DEBUG(args)
 #endif /* __GSOCKET_DEBUG__ */
 
+/* static */
+wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket)
+{
+    return new wxSocketImplUnix(wxsocket);
+}
+
 
 /*
  *  Disallow further read/write operations on this socket, close
@@ -1680,4 +1686,5 @@ wxSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf)
   return wxSOCKET_NOERROR;
 }
 #endif  /* !defined(__VISAGECPP__) */
+
 #endif  /* wxUSE_SOCKETS */