// 第一步 DNS地址解析
rt_kprintf("calling gethostbyname with: %s\r\n", host_name);
yeelink_host = gethostbyname(host_name);
yeelink_ipaddr.s_addr = *(unsigned long *) yeelink_host->h_addr_list[0];
rt_kprintf("Yeelink IP Address:%s\r\n" , inet_ntoa(yeelink_ipaddr));
yeelink_sockaddr.sin_family = AF_INET;
yeelink_sockaddr.sin_port = htons(80);
yeelink_sockaddr.sin_addr = yeelink_ipaddr;
rt_memset(&(yeelink_sockaddr.sin_zero), 0, sizeof(yeelink_sockaddr.sin_zero));
while(1)
{
|
———————————————— 版权声明:本文为CSDN博主「weixin_39575047」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/weixin_39575047/article/details/111497555