fixed the exception of close socket and added dhcp and dns demo

This commit is contained in:
wlyu
2022-01-06 20:37:34 +08:00
parent a0337a42e3
commit acd53026b0
11 changed files with 185 additions and 81 deletions
@@ -246,7 +246,7 @@ netconn_delete(struct netconn *conn)
} else
#endif /* LWIP_NETCONN_FULLDUPLEX */
{
err = netconn_prepare_delete(conn);
// err = netconn_prepare_delete(conn);
}
if (err == ERR_OK) {
netconn_free(conn);
@@ -601,8 +601,14 @@ tcpip_callbackmsg_trycallback_fromisr(struct tcpip_callback_msg *msg)
void
tcpip_init(tcpip_init_done_fn initfunc, void *arg)
{
static int tcpip_flag = 0;
lwip_init();
if(tcpip_flag)
return;
tcpip_flag = 1;
tcpip_init_done = initfunc;
tcpip_init_done_arg = arg;
if (sys_mbox_new(&tcpip_mbox, TCPIP_MBOX_SIZE) != ERR_OK) {