Commit e16ac3e1 authored by 黄振令's avatar 黄振令

【修改内容】去掉无用code

【提交人】huang.zhenling
parent b6f4de61
...@@ -282,18 +282,6 @@ void *udp_dispatch_yield(void *args){ ...@@ -282,18 +282,6 @@ void *udp_dispatch_yield(void *args){
{ {
ERROR_PRINT("socket error\n"); ERROR_PRINT("socket error\n");
} }
#if 0
const int opt = 1;
//设置该套接字为广播类型,
int nb = 0;
nb = setsockopt(sock, SOL_SOCKET, SO_BROADCAST| SO_REUSEADDR, (char *)&opt, sizeof(opt));
if(nb == -1)
{
DEBUG("set socket error...\n");
}
#endif
if(bind(sock,(struct sockaddr *)&(addrto), sizeof(struct sockaddr_in)) == -1) if(bind(sock,(struct sockaddr *)&(addrto), sizeof(struct sockaddr_in)) == -1)
{ {
...@@ -412,30 +400,6 @@ void *udp_dispatch_yield(void *args){ ...@@ -412,30 +400,6 @@ void *udp_dispatch_yield(void *args){
} }
/*if(strcmp(szDec,"search_kk_gw|null") == 0){
HAL_Get_IP(host_ip,"ens33");
HAL_Get_mac(mac);
sprintf(szOut,"search_kk_gw_ack|mac=%s;ip=%s",mac,host_ip);
DEBUG_PRINT("szOut:%s\n",szOut);
DEBUG_PRINT("udp client ip:%s ,port is :%d htons(UDP_LAN_PORT)=%d \n",inet_ntoa(from.sin_addr),from.sin_port, htons(UDP_LAN_PORT));
//sendto(sock, szOut, strlen(szOut), 0, (struct sockaddr*)&from,len);
addrto_host.sin_addr.s_addr = inet_addr(inet_ntoa(from.sin_addr));
//addrto_host.sin_port = htons(UDP_LAN_PORT_HOST);
addrto_host.sin_port = from.sin_port;
if(strcmp(host_ip,inet_ntoa(from.sin_addr)) == 0)
{
sendto(sock_host, szOut, strlen(szOut), 0, (struct sockaddr*)&addrto_host,sizeof(addrto_host));
}
else
{
DEBUG_PRINT("udp client is not local ip , refused send ack to it\n");
}
}else{
DEBUG_PRINT("strmp error\n");
}*/
} }
usleep(100000); usleep(100000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment