only initialize sockets if IPC implementation is socket-based
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,6 +26,8 @@
|
|||||||
#include "wx/ipc.h"
|
#include "wx/ipc.h"
|
||||||
#include "wx/thread.h"
|
#include "wx/thread.h"
|
||||||
|
|
||||||
|
#define wxUSE_SOCKETS_FOR_IPC (!wxUSE_DDE_FOR_IPC)
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -91,8 +93,10 @@ public:
|
|||||||
{
|
{
|
||||||
m_conn = NULL;
|
m_conn = NULL;
|
||||||
|
|
||||||
|
#if wxUSE_SOCKETS_FOR_IPC
|
||||||
// we must call this from the main thread
|
// we must call this from the main thread
|
||||||
wxSocketBase::Initialize();
|
wxSocketBase::Initialize();
|
||||||
|
#endif // wxUSE_SOCKETS_FOR_IPC
|
||||||
|
|
||||||
// we need event dispatching to work for IPC server to work
|
// we need event dispatching to work for IPC server to work
|
||||||
m_thread = new EventThread;
|
m_thread = new EventThread;
|
||||||
@@ -109,7 +113,9 @@ public:
|
|||||||
|
|
||||||
delete m_conn;
|
delete m_conn;
|
||||||
|
|
||||||
|
#if wxUSE_SOCKETS_FOR_IPC
|
||||||
wxSocketBase::Shutdown();
|
wxSocketBase::Shutdown();
|
||||||
|
#endif // wxUSE_SOCKETS_FOR_IPC
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic)
|
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic)
|
||||||
@@ -202,8 +208,7 @@ private:
|
|||||||
DECLARE_NO_COPY_CLASS(IPCTestCase)
|
DECLARE_NO_COPY_CLASS(IPCTestCase)
|
||||||
};
|
};
|
||||||
|
|
||||||
// this test is not enabled by default because it requires an IPC server to run
|
CPPUNIT_TEST_SUITE_REGISTRATION( IPCTestCase );
|
||||||
//CPPUNIT_TEST_SUITE_REGISTRATION( IPCTestCase );
|
|
||||||
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( IPCTestCase, "IPCTestCase" );
|
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( IPCTestCase, "IPCTestCase" );
|
||||||
|
|
||||||
void IPCTestCase::Connect()
|
void IPCTestCase::Connect()
|
||||||
|
Reference in New Issue
Block a user