]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/socket.cpp
source id type is unsigned; minor cleanup
[wxWidgets.git] / src / common / socket.cpp
index 11d97cccc433cba57f797ac6e210cf7ed3179f2e..e36bfe9768f3ec07e2fbd04b125eb6afff30cf62 100644 (file)
     #include "wx/app.h"
     #include "wx/utils.h"
     #include "wx/timer.h"
+    #include "wx/module.h"
 #endif
 
 #include "wx/apptrait.h"
-#include "wx/module.h"
 
 #include "wx/sckaddr.h"
 #include "wx/datetime.h"
@@ -1344,14 +1344,18 @@ wxDatagramSocket::wxDatagramSocket( const wxSockAddress& addr,
     // Create the socket
     m_socket = GSocket_new();
 
-    if(!m_socket)
+    if (!m_socket)
     {
         wxFAIL_MSG( _T("datagram socket not new'd") );
         return;
     }
     // Setup the socket as non connection oriented
     m_socket->SetLocal(addr.GetAddress());
-    if( m_socket->SetNonOriented() != GSOCK_NOERROR )
+    if (flags & wxSOCKET_REUSEADDR)
+    {
+        m_socket->SetReusable();
+    }
+    if ( m_socket->SetNonOriented() != GSOCK_NOERROR )
     {
         delete m_socket;
         m_socket = NULL;