X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e59461fff579fcffaaf97baabcfc9f7504e4fed6..a13acfd8038210b0396816b6e078a92219a33539:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 4d98262d30..1acebe08f8 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -40,6 +40,7 @@ #include "wx/sckaddr.h" #include "wx/socket.h" +#include "wx/stopwatch.h" // DLL options compatibility check: #include "wx/build.h" @@ -1153,6 +1154,8 @@ bool wxSocketServer::WaitForAccept(long seconds, long milliseconds) bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen) { + wxASSERT_MSG( m_socket, _T("Socket not initialised") ); + if (m_socket->GetSockOpt(level, optname, optval, optlen) != GSOCK_NOERROR) { @@ -1164,6 +1167,8 @@ bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen) bool wxSocketBase::SetOption(int level, int optname, const void *optval, int optlen) { + wxASSERT_MSG( m_socket, _T("Socket not initialised") ); + if (m_socket->SetSockOpt(level, optname, optval, optlen) != GSOCK_NOERROR) { @@ -1303,6 +1308,8 @@ wxDatagramSocket& wxDatagramSocket::SendTo( wxSockAddress& addr, const void* buf, wxUint32 nBytes ) { + wxASSERT_MSG( m_socket, _T("Socket not initialised") ); + m_socket->SetPeer(addr.GetAddress()); Write(buf, nBytes); return (*this);