X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/635f2bad9037c6911097b6903057d8ab09336a86..d2b23b67301bd2d286366d4326a21da3132558fa:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 080518cd0e..e36bfe9768 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -32,11 +32,11 @@ #include "wx/event.h" #include "wx/app.h" #include "wx/utils.h" + #include "wx/timer.h" + #include "wx/module.h" #endif #include "wx/apptrait.h" -#include "wx/timer.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;