#include "wx/stopwatch.h"
#include "wx/thread.h"
#include "wx/evtloop.h"
+#include "wx/link.h"
#include "wx/private/fd.h"
#include "wx/private/socket.h"
// this should cover all the current Unix systems (Windows never sends any
// signals anyhow) but if we find one that has neither we should explicitly
// ignore SIGPIPE for it
+// OpenVMS has neither MSG_NOSIGNAL nor SO_NOSIGPIPE. However the socket sample
+// seems to work. Not sure if problems will show up on OpenVMS using sockets.
#ifdef MSG_NOSIGNAL
#define wxSOCKET_MSG_NOSIGNAL MSG_NOSIGNAL
#else // MSG_NOSIGNAL not available (BSD including OS X)
- #if defined(__UNIX__) && !defined(SO_NOSIGPIPE)
+ #if defined(__UNIX__) && !defined(SO_NOSIGPIPE) && !defined( __VMS )
#error "Writing to socket could generate unhandled SIGPIPE."
#error "Please post information about your system to wx-dev."
#endif
// macros and constants
// --------------------------------------------------------------------------
+// event
+wxDEFINE_EVENT(wxEVT_SOCKET, wxSocketEvent);
+
// discard buffer
#define MAX_DISCARD_SIZE (10 * 1024)
{
// this Initialize() will be undone by wxSocketModule::OnExit(), all
// the other calls to it should be matched by a call to Shutdown()
- Initialize();
+ if (!Initialize())
+ wxLogError("Cannot initialize wxSocketBase");
}
}
IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule)
+#if defined(wxUSE_SELECT_DISPATCHER) && wxUSE_SELECT_DISPATCHER
+// NOTE: we need to force linking against socketiohandler.cpp otherwise in
+// static builds of wxWidgets the ManagerSetter::ManagerSetter ctor
+// contained there wouldn't be ever called
+wxFORCE_LINK_MODULE( socketiohandler )
+#endif
+
#endif // wxUSE_SOCKETS