FIX:fixed issue with sending message
This commit is contained in:
@@ -14,10 +14,13 @@ namespace DirectCommunication
|
||||
DirectCommunicationClient::DirectCommunicationClient(ushort port, std::string ServerAddress):port_(port),serverAddress_(ServerAddress)
|
||||
{
|
||||
|
||||
context_ = zmq::context_t(1);
|
||||
context_ = zmq::context_t();
|
||||
socket_ = zmq::socket_t(context_,zmq::socket_type::client);
|
||||
LOG_S(INFO)<< "tcp://"+serverAddress_+":"+std::to_string(port_);
|
||||
|
||||
socket_.connect("tcp://"+serverAddress_+":"+std::to_string(port_));
|
||||
isConnected = true;
|
||||
|
||||
socket_.set(zmq::sockopt::rcvtimeo,100);
|
||||
socket_.set(zmq::sockopt::sndtimeo,500);
|
||||
|
||||
@@ -31,6 +34,8 @@ namespace DirectCommunication
|
||||
DirectCommunicationClient::~DirectCommunicationClient()
|
||||
{
|
||||
sendMessage("CLOSE");
|
||||
isConnected = false;
|
||||
|
||||
stopWorker_ = true;
|
||||
Worker_.join();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user