pubsub: Print out the message if no listener was found.

This commit is contained in:
Christoph Heiss 2018-03-01 17:56:05 +01:00
parent b27cc818e9
commit 5fa2f85f3a

View file

@ -102,7 +102,7 @@ public:
asio::error_code error_code;
asio::ip::tcp::resolver resolver{io_context_};
auto results = resolver.resolve(host_, port_, error_code);
auto results{resolver.resolve(host_, port_, error_code)};
check_asio_error(error_code);
asio::connect(socket_, results, error_code);
@ -149,6 +149,9 @@ public:
if (channel_callbacks_.count(channel)) {
channel_callbacks_[channel](channel, message);
} else {
std::cout << "Message on channel '" << channel
<< "': " << message << std::endl;
}
}
}