]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/socket.cpp
clipboard handler must be extern C (Sun CC warning)
[wxWidgets.git] / src / common / socket.cpp
index 4d98262d3015f5d04cb0403656c8c9b1699c05b5..1acebe08f87f76f43574f18fe215363362bcc350 100644 (file)
@@ -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);