Skip to content
Snippets Groups Projects
Commit 074e00af authored by Maël Madon's avatar Maël Madon
Browse files

fix: compile warnings boost cpp >14 and zmq send and recv

parent 19ace6c4
No related branches found
No related tags found
No related merge requests found
project('batmen', 'cpp', project('batmen', 'cpp',
version: '1.0', version: '1.0',
license: 'LGPLv3', license: 'LGPLv3',
default_options: ['cpp_std=c++11'], default_options: ['cpp_std=c++14'],
meson_version: '>=0.40.0' meson_version: '>=0.40.0'
) )
......
...@@ -32,17 +32,13 @@ void Network::bind(const std::string &socket_endpoint) ...@@ -32,17 +32,13 @@ void Network::bind(const std::string &socket_endpoint)
void Network::write(const string &content) void Network::write(const string &content)
{ {
// Let's make sure the sent message is in UTF-8 _socket->send(zmq::buffer(content), zmq::send_flags::none);
string msg_utf8 = boost::locale::conv::to_utf<char>(content, "UTF-8");
LOG_F(INFO, "Sending '%s'", msg_utf8.c_str());
_socket->send(msg_utf8.data(), msg_utf8.size());
} }
void Network::read(string &received_content) void Network::read(string &received_content)
{ {
zmq::message_t message; zmq::message_t message;
_socket->recv(&message); _socket->recv(message, zmq::recv_flags::none);
received_content = string((char*)message.data(), message.size()); received_content = string((char*)message.data(), message.size());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment