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

This commit is contained in:
Dick Hollenbeck 2012-08-24 06:31:09 -05:00
parent 96771ccc03
commit 0c4c65d7a2
2 changed files with 11 additions and 21 deletions

View File

@ -6,19 +6,17 @@
#include <eda_dde.h>
#include <wxstruct.h>
#include <id.h>
#include <common.h>
#include <macros.h>
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 )
{

View File

@ -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 <wx/socket.h>
#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_