#include "wx/sckaddr.h"
#include "wx/socket.h"
+#include "wx/stopwatch.h"
// DLL options compatibility check:
#include "wx/build.h"
BTW, the main thread must not be stopped using sleep or block
on a semaphore (a bad idea in any case) or socket operations
will time out.
+
+ On the Mac side, Initialize() stores a pointer to the CFRunLoop for
+ the main thread. Because secondary threads do not have run loops,
+ adding event notifications to the "Current" loop would have no
+ effect at all, events would never fire.
*/
wxASSERT_MSG( wxIsMainThread(),
wxT("Call wxSocketBase::Initialize() from the main thread first!"));
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)
{
const void* buf,
wxUint32 nBytes )
{
+ wxASSERT_MSG( m_socket, _T("Socket not initialised") );
+
m_socket->SetPeer(addr.GetAddress());
Write(buf, nBytes);
return (*this);