mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-24 13:37:03 +02:00
basic JSON-RPC parser
This commit is contained in:
parent
77eab9f681
commit
ccc84fb916
2 changed files with 96 additions and 7 deletions
|
@ -115,11 +115,11 @@ void ControlSession::reader()
|
|||
{
|
||||
boost::asio::streambuf response;
|
||||
boost::asio::read_until(*socket_, response, "\r\n");
|
||||
std::istream response_stream(&response);
|
||||
std::string strResponse;
|
||||
response_stream >> strResponse;
|
||||
std::string s((istreambuf_iterator<char>(&response)), istreambuf_iterator<char>());
|
||||
s.resize(s.length() - 2);
|
||||
|
||||
if (messageReceiver_ != NULL)
|
||||
messageReceiver_->onMessageReceived(this, strResponse);
|
||||
messageReceiver_->onMessageReceived(this, s);
|
||||
}
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue