KiCad PCB EDA Suite
eda_dde.cpp File Reference
#include <condition_variable>
#include <mutex>
#include <thread>
#include <eda_dde.h>
#include <kiway_player.h>
#include <id.h>
#include <wx/crt.h>

Go to the source code of this file.

Classes

class  ASYNC_SOCKET_HOLDER
 Spin up a thread to send messages via a socket. More...
 

Macros

#define IPC_BUF_SIZE   4096
 

Functions

static const wxString HOSTNAME (wxT("localhost"))
 
bool SendCommand (int aService, const std::string &aMessage)
 Used by a client to sent (by a socket connection) a data to a server. More...
 
void SocketCleanup ()
 

Variables

static char client_ipc_buffer [IPC_BUF_SIZE]
 
std::unique_ptr< ASYNC_SOCKET_HOLDERsocketHolder = nullptr
 

Macro Definition Documentation

◆ IPC_BUF_SIZE

#define IPC_BUF_SIZE   4096

Definition at line 39 of file eda_dde.cpp.

Function Documentation

◆ HOSTNAME()

static const wxString HOSTNAME ( wxT("localhost")  )
static

◆ SendCommand()

bool SendCommand ( int  aService,
const std::string &  aMessage 
)

Used by a client to sent (by a socket connection) a data to a server.

Must be called to clean up the socket thread used by SendCommand.

  • Open a Socket Client connection.
  • Send the buffer cmdline.
  • Close the socket connection.
Parameters
aServiceis the service number for the TC/IP connection.
aMessageis the message to send.

Definition at line 304 of file eda_dde.cpp.

305 {
306  if( !socketHolder )
307  socketHolder.reset( new ASYNC_SOCKET_HOLDER() );
308 
309  return socketHolder->Send( aService, aMessage );
310 }
Spin up a thread to send messages via a socket.
Definition: eda_dde.cpp:120
std::unique_ptr< ASYNC_SOCKET_HOLDER > socketHolder
Definition: eda_dde.cpp:292

References socketHolder.

Referenced by SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), and SCH_EDIT_FRAME::SetCrossProbeConnection().

◆ SocketCleanup()

void SocketCleanup ( )

Definition at line 313 of file eda_dde.cpp.

314 {
315  if( socketHolder )
316  socketHolder.reset();
317 }
std::unique_ptr< ASYNC_SOCKET_HOLDER > socketHolder
Definition: eda_dde.cpp:292

References socketHolder.

Referenced by EDA_BASE_FRAME::~EDA_BASE_FRAME().

Variable Documentation

◆ client_ipc_buffer

char client_ipc_buffer[IPC_BUF_SIZE]
static

Definition at line 40 of file eda_dde.cpp.

Referenced by KIWAY_PLAYER::OnSockRequest().

◆ socketHolder

std::unique_ptr<ASYNC_SOCKET_HOLDER> socketHolder = nullptr

Definition at line 292 of file eda_dde.cpp.

Referenced by SendCommand(), and SocketCleanup().