X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0badb709a86b91a203416784b649e3d00c699c7..80f8355d6639f1bb13b00a64cb27aaa2b5088185:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 11d97cccc4..e36bfe9768 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -33,10 +33,10 @@ #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;