// Declarations
// ==========================================================================
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "socket.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
public:
wxSocketState() : wxObject() {}
- DECLARE_NO_COPY_CLASS(wxSocketState)
+ DECLARE_NO_COPY_CLASS(wxSocketState)
};
// ==========================================================================
// Ctor
// --------------------------------------------------------------------------
-wxSocketServer::wxSocketServer(wxSockAddress& addr_man,
+wxSocketServer::wxSocketServer(const wxSockAddress& addr_man,
wxSocketFlags flags)
: wxSocketBase(flags, wxSOCKET_SERVER)
{
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)
{
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)
{
/* NOTE: experimental stuff - might change */
-wxDatagramSocket::wxDatagramSocket( wxSockAddress& addr,
+wxDatagramSocket::wxDatagramSocket( const wxSockAddress& addr,
wxSocketFlags flags )
: wxSocketBase( flags, wxSOCKET_DATAGRAM )
{
return (*this);
}
-wxDatagramSocket& wxDatagramSocket::SendTo( wxSockAddress& addr,
+wxDatagramSocket& wxDatagramSocket::SendTo( const 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);