Browse Source

fixed bug: close socket when ping() exit.

aozima 11 years ago
parent
commit
f296c582a5
2 changed files with 4 additions and 0 deletions
  1. 2 0
      components/net/lwip-1.3.2/apps/ping.c
  2. 2 0
      components/net/lwip/apps/ping.c

+ 2 - 0
components/net/lwip-1.3.2/apps/ping.c

@@ -166,6 +166,8 @@ rt_err_t ping(char* target, rt_uint32_t time, rt_size_t size)
 
 		rt_thread_delay(PING_DELAY); /* take a delay */
 	}
+	
+	lwip_close(s);
 
 	return RT_EOK;
 }

+ 2 - 0
components/net/lwip/apps/ping.c

@@ -166,6 +166,8 @@ rt_err_t ping(char* target, rt_uint32_t time, rt_size_t size)
 
 		rt_thread_delay(PING_DELAY); /* take a delay */
 	}
+	
+	lwip_close(s);
 
 	return RT_EOK;
 }