HuobiRDCenter/huobi_Cpp

Websocket client is being destroyed

ForeverZyh opened this issue · 3 comments

client.subDepth(symbol, "step5", [](Depth depth) {
	cout << "subDepth" << endl;
	cout << depth.ts << endl;
	cout << depth.asks[0].price << endl;
  });

https://github.com/HuobiRDCenter/huobi_Cpp/blob/master/src/client/websocketMarketClient.cpp
After running for 3-4 minutes, the code captures an exception: "Websocket client is being destroyed" in Lines 39-43.

writer.String(to_string(pong).c_str());

I think the pong message should contain a long value, not a string?
Any ideas?

For your first issue, i test it in my machine, but didn't have the same problem.
And i will keep tracking the problem like it ,thank you for your feedback!

writer.String(to_string(pong).c_str());

I think the pong message should contain a long value, not a string?
Any ideas?
it has been fixed by your prompt, thanks a lot!