-void wxSocketBase::DestroyCallbacks()
-{
-  if (!m_cbkon || !m_handler)
-    return;
-    
-  m_cbkon = FALSE;
-  m_processing = FALSE;
-#if defined(__WXMOTIF__) || defined(__WXXT__)
-  if (m_internal->sock_inputid > 0)
-    XtRemoveInput(m_internal->sock_inputid);
-  m_internal->sock_inputid = 0;
-  if (m_internal->sock_outputid > 0)
-    XtRemoveInput(m_internal->sock_outputid);
-  m_internal->sock_outputid = 0;
-#endif
-#ifdef __WXGTK__
-  if (m_internal->sock_inputid > 0)
-    gdk_input_remove(m_internal->sock_inputid);
-  m_internal->sock_inputid = 0;
-  if (m_internal->sock_outputid > 0)
-    gdk_input_remove(m_internal->sock_outputid);
-  m_internal->sock_outputid = 0;
-#endif
-#ifdef __WINDOWS__
-  WSAAsyncSelect(m_fd, m_handler->GetHWND(), 0, 0);
-#endif
-#ifdef __WXMAC__
-  GUSISetReference( m_fd , 0 , 0 ) ;
-  int bottom = wxMacNetEventsBottom ;
-  while ( wxMacNetEventsTop != bottom )
-  {
-    // set all events that reference this socket to nil
-    if ( wxMacNetEventsReferences[bottom] == (void*) this )
-      wxMacNetEventsReferences[bottom] = NULL ;
-    bottom++ ;
-    if ( bottom == kwxMacNetEventsMax )
-      bottom = 0 ;
+      // If we got here and wxSOCKET_WAITALL is not set, we can leave
+      // now. Otherwise, wait until we send all the data or until there
+      // is an error.
+      //
+      more = (ret > 0 && nbytes > 0 && (m_flags & wxSOCKET_WAITALL));
+    }