From 0c4c65d7a2d2a8b613022ed25ddf3452f421ccbe Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Fri, 24 Aug 2012 06:31:09 -0500 Subject: [PATCH] wxServer was a confusing define, since it is also a wxWidgets class, do not use it --- common/eda_dde.cpp | 15 +++++++-------- include/eda_dde.h | 17 ++++------------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/common/eda_dde.cpp b/common/eda_dde.cpp index bb280c8810..8c63881c42 100644 --- a/common/eda_dde.cpp +++ b/common/eda_dde.cpp @@ -6,19 +6,17 @@ #include #include #include - #include #include -wxString HOSTNAME( wxT( "localhost" ) ); - +static const wxString HOSTNAME( wxT( "localhost" ) ); // buffer for read and write data in socket connections #define IPC_BUF_SIZE 4096 -static char client_ipc_buffer[IPC_BUF_SIZE]; +static char client_ipc_buffer[IPC_BUF_SIZE]; -static wxServer* server; +static wxSocketServer* server; void (*RemoteFct)(const char* cmd); @@ -35,17 +33,18 @@ void SetupServerFunction( void (*remotefct)(const char* remotecmd) ) /* Function to initialize a server socket */ -WinEDA_Server* CreateServer( wxWindow* window, int service, bool local ) +wxSocketServer* CreateServer( wxWindow* window, int service, bool local ) { wxIPV4address addr; - // Create a new server + // Set the port number addr.Service( service ); + // Listen on localhost only if requested if( local ) addr.Hostname( HOSTNAME ); - server = new wxServer( addr ); + server = new wxSocketServer( addr ); if( server ) { diff --git a/include/eda_dde.h b/include/eda_dde.h index 856b354a1d..fa831bb22a 100644 --- a/include/eda_dde.h +++ b/include/eda_dde.h @@ -3,15 +3,11 @@ * @brief DDE server & client. */ -#ifndef _EDA_DDE_H_ -#define _EDA_DDE_H_ +#ifndef EDA_DDE_H_ +#define EDA_DDE_H_ #include -#define wxServer wxSocketServer -#define wxClient wxSocketClient -#define WinEDA_Server wxSocketServer - // TCP/IP ports used by Pcbnew and Eeschema respectively. @@ -25,13 +21,8 @@ #define MSG_TO_PCB KICAD_PCB_PORT_SERVICE_NUMBER #define MSG_TO_SCH KICAD_SCH_PORT_SERVICE_NUMBER - -/********************/ -/* autres fonctions */ -/********************/ - -WinEDA_Server * CreateServer( wxWindow * window, int port, bool local = true ); +wxSocketServer* CreateServer( wxWindow * window, int port, bool local = true ); bool SendCommand( int port, const char* cmdline ); void SetupServerFunction( void (*remotefct) (const char* remotecmd) ); -#endif // _EDA_DDE_H_ +#endif // EDA_DDE_H_