Skip to content

Commit

Permalink
Merge pull request tkn-tub#28 from edalm/fix-zmq-deprecated-functions
Browse files Browse the repository at this point in the history
Fix use of ZMQ's deprecated send() and recv() functions
  • Loading branch information
pgawlowicz authored Jun 9, 2020
2 parents 470362b + bdd4ccc commit 19bfe0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/opengym/model/opengym_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ OpenGymInterface::SetExecuteActionsCb(Callback<bool, Ptr<OpenGymDataContainer> >
m_actionCb = cb;
}

void
void
OpenGymInterface::Init()
{
NS_LOG_FUNCTION (this);
Expand Down Expand Up @@ -189,12 +189,12 @@ OpenGymInterface::Init()
// send init msg to python
zmq::message_t request(simInitMsg.ByteSize());;
simInitMsg.SerializeToArray(request.data(), simInitMsg.ByteSize());
m_zmq_socket.send (request);
m_zmq_socket.send (request, zmq::send_flags::none);

// receive init ack msg form python
ns3opengym::SimInitAck simInitAck;
zmq::message_t reply;
m_zmq_socket.recv (&reply);
(void) m_zmq_socket.recv (reply, zmq::recv_flags::none);
simInitAck.ParseFromArray(reply.data(), reply.size());

bool done = simInitAck.done();
Expand Down Expand Up @@ -256,12 +256,12 @@ OpenGymInterface::NotifyCurrentState()
// send env state msg to python
zmq::message_t request(envStateMsg.ByteSize());;
envStateMsg.SerializeToArray(request.data(), envStateMsg.ByteSize());
m_zmq_socket.send (request);
m_zmq_socket.send (request, zmq::send_flags::none);

// receive act msg form python
ns3opengym::EnvActMsg envActMsg;
zmq::message_t reply;
m_zmq_socket.recv (&reply);
(void) m_zmq_socket.recv (reply, zmq::recv_flags::none);
envActMsg.ParseFromArray(reply.data(), reply.size());

if (m_simEnd) {
Expand Down

0 comments on commit 19bfe0a

Please sign in to comment.