Commit 0c4c65d7 authored by Dick Hollenbeck's avatar Dick Hollenbeck

wxServer was a confusing define, since it is also a wxWidgets class, do not use it

parent 96771ccc
...@@ -6,19 +6,17 @@ ...@@ -6,19 +6,17 @@
#include <eda_dde.h> #include <eda_dde.h>
#include <wxstruct.h> #include <wxstruct.h>
#include <id.h> #include <id.h>
#include <common.h> #include <common.h>
#include <macros.h> #include <macros.h>
wxString HOSTNAME( wxT( "localhost" ) ); static const wxString HOSTNAME( wxT( "localhost" ) );
// buffer for read and write data in socket connections // buffer for read and write data in socket connections
#define IPC_BUF_SIZE 4096 #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); void (*RemoteFct)(const char* cmd);
...@@ -35,17 +33,18 @@ void SetupServerFunction( void (*remotefct)(const char* remotecmd) ) ...@@ -35,17 +33,18 @@ void SetupServerFunction( void (*remotefct)(const char* remotecmd) )
/* Function to initialize a server socket /* 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; wxIPV4address addr;
// Create a new server // Set the port number
addr.Service( service ); addr.Service( service );
// Listen on localhost only if requested // Listen on localhost only if requested
if( local ) if( local )
addr.Hostname( HOSTNAME ); addr.Hostname( HOSTNAME );
server = new wxServer( addr ); server = new wxSocketServer( addr );
if( server ) if( server )
{ {
......
...@@ -3,15 +3,11 @@ ...@@ -3,15 +3,11 @@
* @brief DDE server & client. * @brief DDE server & client.
*/ */
#ifndef _EDA_DDE_H_ #ifndef EDA_DDE_H_
#define _EDA_DDE_H_ #define EDA_DDE_H_
#include <wx/socket.h> #include <wx/socket.h>
#define wxServer wxSocketServer
#define wxClient wxSocketClient
#define WinEDA_Server wxSocketServer
// TCP/IP ports used by Pcbnew and Eeschema respectively. // TCP/IP ports used by Pcbnew and Eeschema respectively.
...@@ -25,13 +21,8 @@ ...@@ -25,13 +21,8 @@
#define MSG_TO_PCB KICAD_PCB_PORT_SERVICE_NUMBER #define MSG_TO_PCB KICAD_PCB_PORT_SERVICE_NUMBER
#define MSG_TO_SCH KICAD_SCH_PORT_SERVICE_NUMBER #define MSG_TO_SCH KICAD_SCH_PORT_SERVICE_NUMBER
wxSocketServer* CreateServer( wxWindow * window, int port, bool local = true );
/********************/
/* autres fonctions */
/********************/
WinEDA_Server * CreateServer( wxWindow * window, int port, bool local = true );
bool SendCommand( int port, const char* cmdline ); bool SendCommand( int port, const char* cmdline );
void SetupServerFunction( void (*remotefct) (const char* remotecmd) ); void SetupServerFunction( void (*remotefct) (const char* remotecmd) );
#endif // _EDA_DDE_H_ #endif // EDA_DDE_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment