KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 310 of file eda_dde.cpp.

References socketHolder.

Referenced by CVPCB_MAINFRAME::SendComponentSelectionToSch(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), PCB_EDIT_FRAME::SendCrossProbeItem(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), SCH_EDIT_FRAME::SendSelectItemsToPcb(), PCB_EDIT_FRAME::SendSelectItemsToSch(), and SCH_EDIT_FRAME::SetCrossProbeConnection().

◆ SocketCleanup()

void SocketCleanup ( )

Definition at line 319 of file eda_dde.cpp.

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

Referenced by SendCommand(), and SocketCleanup().