From e54b8e58780c7d9f37b06cc4e1dc88badb2129c9 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期二, 18 五月 2021 17:02:21 +0800
Subject: [PATCH] remove sync recv, node cache msgs for sync recv.

---
 src/msg.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/msg.h b/src/msg.h
index e8af3c5..42a753e 100644
--- a/src/msg.h
+++ b/src/msg.h
@@ -209,6 +209,17 @@
 		p += 4;
 		return head.ParseFromArray(p, msg_size);
 	}
+	std::string body() const
+	{
+		auto p = get<char>();
+		assert(p);
+		uint32_t size = Get32(p);
+		p += 4;
+		p += size;
+		size = Get32(p);
+		p += 4;
+		return std::string(p, size);
+	}
 	template <class Body>
 	bool ParseBody(Body &body) const
 	{

--
Gitblit v1.8.0