提交 f6c08c5f 编写于 作者: K Kai He

net io recv bug fixed

上级 d1468cd7
...@@ -138,6 +138,9 @@ public: ...@@ -138,6 +138,9 @@ public:
if (ret < 0) { if (ret < 0) {
throw std::runtime_error("socket error: recv, errno: " + throw std::runtime_error("socket error: recv, errno: " +
std::to_string(errno)); std::to_string(errno));
} else if (ret == 0) {
throw std::runtime_error("socket error: 0 byte recved, "
"socket shutdown by peer");
} }
recved += ret; recved += ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册