提交 8d4d8a83 编写于 作者: wuyangyong's avatar wuyangyong

fixed bug: close sock when connect fail.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2287 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 7ce935b6
......@@ -44,7 +44,8 @@ void tcpclient(const char* url, int port)
if (connect(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1)
{
/* 连接失败 */
rt_kprintf("Connect error\n");
rt_kprintf("Connect fail!\n");
lwip_close(sock);
/*释放接收缓冲 */
rt_free(recv_data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册