mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-17 07:05:31 +08:00
fixed recv issue in tcp client example.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2126 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
1 parent
844bca0bd6
commit
c891da75df
1 file changed
+1
-1
@@ -53,7 +53,7 @@ void tcpclient(const char* url, int port)
|
||||
{
|
||||
/* 从sock连接中接收最大1024字节数据 */
|
||||
bytes_received = recv(sock, recv_data, 1024, 0);
|
||||
if (bytes_received < 0)
|
||||
if (bytes_received <= 0)
|
||||
{
|
||||
/* 接收失败,关闭这个连接 */
|
||||
lwip_close(sock);
|
||||
|
||||
Reference in new issue
Block a user