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

Go to the source code of this file.

Classes

class  ASYNC_SOCKET_HOLDER
 Spins 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)
 Must be called to clean up the socket thread used by SendCommand. 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 38 of file eda_dde.cpp.

Function Documentation

◆ HOSTNAME()

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

◆ SendCommand()

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

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

Definition at line 312 of file eda_dde.cpp.

313 {
314  if( !socketHolder )
315  socketHolder.reset( new ASYNC_SOCKET_HOLDER() );
316 
317  return socketHolder->Send( aService, aMessage );
318 }
Spins up a thread to send messages via a socket.
Definition: eda_dde.cpp:132
std::unique_ptr< ASYNC_SOCKET_HOLDER > socketHolder
Definition: eda_dde.cpp:303

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 321 of file eda_dde.cpp.

322 {
323  if( socketHolder )
324  socketHolder.reset();
325 }
std::unique_ptr< ASYNC_SOCKET_HOLDER > socketHolder
Definition: eda_dde.cpp:303

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 39 of file eda_dde.cpp.

Referenced by EDA_DRAW_FRAME::OnSockRequest().

◆ socketHolder

std::unique_ptr<ASYNC_SOCKET_HOLDER> socketHolder = nullptr

Definition at line 303 of file eda_dde.cpp.

Referenced by SendCommand(), and SocketCleanup().