提交 844bca0b 编写于 作者: B bernard.xiong@gmail.com

fixed recv issue in tcp server example.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2125 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 3343a1b7
......@@ -76,7 +76,7 @@ void tcpserv(void* parameter)
/* 从connected socket中接收数据,接收buffer是1024大小,但并不一定能够收到1024大小的数据 */
bytes_received = recv(connected,recv_data, 1024, 0);
if (bytes_received < 0)
if (bytes_received <= 0)
{
/* 接收失败,关闭这个connected socket */
lwip_close(connected);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册