|
@@ -5,6 +5,7 @@
|
|
|
|
|
|
#include <string>
|
|
|
#include <boost/asio.hpp>
|
|
|
+#include <json/json.h>
|
|
|
|
|
|
#define BLOCKSIZE 8
|
|
|
|
|
@@ -15,8 +16,18 @@ protected:
|
|
|
boost::asio::io_service ios;
|
|
|
tcp::socket *tcpsock;
|
|
|
boost::system::error_code errcode;
|
|
|
- std::string *ipstring;
|
|
|
+ std::string ipstring;
|
|
|
int port;
|
|
|
+
|
|
|
+ std::string jsonerror;
|
|
|
+
|
|
|
+ Json::CharReaderBuilder rbuilder;
|
|
|
+ Json::CharReader* reader;
|
|
|
+ Json::StreamWriterBuilder wbuilder;
|
|
|
+
|
|
|
+ bool sendJson(Json::Value root);
|
|
|
+ bool receiveJson(boost::asio::streambuf &recvbuf);
|
|
|
+ bool parseJson(Json::Value *root, boost::asio::streambuf &recvbuf);
|
|
|
public:
|
|
|
// Basic constructor
|
|
|
IoManager(char *ipcstring);
|