summaryrefslogtreecommitdiff
path: root/examples/network/udpclient.c
diff options
context:
space:
mode:
authorSummerGift <[email protected]>2017-10-27 15:49:27 +0800
committerSummerGift <[email protected]>2017-10-27 16:10:41 +0800
commit89cc00a91cc88f8a8856b3c44596b9e3e1979f54 (patch)
tree168bba29dbf22ccc41734e3ba57147ed33f6afbb /examples/network/udpclient.c
parent1b37cd7dd07f84988113101974ae72af40178251 (diff)
update examples/network/udpclient.c examples/network/udpserver.c
Diffstat (limited to 'examples/network/udpclient.c')
-rw-r--r--examples/network/udpclient.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/network/udpclient.c b/examples/network/udpclient.c
index 50e0d39784..c19a25fa6c 100644
--- a/examples/network/udpclient.c
+++ b/examples/network/udpclient.c
@@ -1,6 +1,8 @@
#include <rtthread.h>
-#include <lwip/netdb.h> /* 为了解析主机名,需要包含netdb.h头文件 */
-#include <lwip/sockets.h> /* 使用BSD socket,需要包含sockets.h头文件 */
+//#include <lwip/netdb.h> /* 为了解析主机名,需要包含netdb.h头文件 */
+//#include <lwip/sockets.h> /* 使用BSD socket,需要包含sockets.h头文件 */
+#include <sys/socket.h> /* 使用BSD socket,需要包含sockets.h头文件 */
+#include "netdb.h"
const char send_data[] = "This is UDP Client from RT-Thread.\n"; /* 发送用到的数据 */
void udpclient(const char* url, int port, int count)
@@ -40,7 +42,7 @@ void udpclient(const char* url, int port, int count)
}
/* 关闭这个socket */
- lwip_close(sock);
+ closesocket(sock);
}
#ifdef RT_USING_FINSH