This commit is contained in:
Jon Evans 2021-03-22 23:42:48 -04:00
parent 4dbeb15024
commit 9020611657
1 changed files with 4 additions and 13 deletions

View File

@ -25,7 +25,6 @@
#include <condition_variable> #include <condition_variable>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include <queue>
#include <eda_dde.h> #include <eda_dde.h>
#include <eda_draw_frame.h> #include <eda_draw_frame.h>
@ -33,8 +32,6 @@
#include <wx/wx.h> #include <wx/wx.h>
using namespace std::chrono_literals;
static const 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
@ -197,7 +194,6 @@ private:
return; return;
wxSocketClient* sock_client; wxSocketClient* sock_client;
bool success = false;
wxIPV4address addr; wxIPV4address addr;
// Create a connexion // Create a connexion
@ -260,7 +256,6 @@ private:
if( sock_client->Ok() && sock_client->IsConnected() ) if( sock_client->Ok() && sock_client->IsConnected() )
{ {
success = true;
sock_client->SetFlags( wxSOCKET_NOWAIT /*wxSOCKET_WAITALL*/ ); sock_client->SetFlags( wxSOCKET_NOWAIT /*wxSOCKET_WAITALL*/ );
sock_client->Write( m_message.second.c_str(), m_message.second.length() ); sock_client->Write( m_message.second.c_str(), m_message.second.length() );
} }
@ -273,14 +268,10 @@ private:
} }
std::pair<int, std::string> m_message; std::pair<int, std::string> m_message;
bool m_messageReady;
bool m_messageReady; mutable std::mutex m_mutex;
std::condition_variable m_cv;
mutable std::mutex m_mutex; bool m_shutdown;
std::condition_variable m_cv;
bool m_shutdown;
}; };