autobahn-cpp
autobahn-cpp copied to clipboard
client does not see keyword results
When returning a result, my server side code does something like:
std::string ts = "2016-03-14 9:56:13";
autobahn::wamp_kw_arguments res;
res["ts"] = ts;
res["kw"] = -15;
std::tuple<int> status = std::make_tuple(5);
invocation->result(status, res);
and the server log shows:
TX message: yield [1, {}, [5], {"kw"=>-15, "ts"=>"2016-03-14 9:56:13"}]
So it looks like the keyword result is being transmitted correctly, but the client side fails to see any keywords variables in the result.
auto kw_args = result.get().kw_arguments<std::unordered_map<std::string, msgpack::object>>();
if (kw_args.empty())
std::cerr << "kw args empty.\n";
else
std::cerr << "Have kw\n";
Results in:
kw args empty.
I have tried accessing the keyword arguments every way I can think of and nothing works.
John