From 73e78bdc005f967d3696ca7e884b71312036e18a Mon Sep 17 00:00:00 2001 From: "mbbill@gmail.com" Date: Mon, 30 May 2011 02:16:24 +0000 Subject: [PATCH] Modified net apps for lwip1.4.0 git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1440 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/net/apps/tcpecho.c | 6 +++--- components/net/apps/udpecho.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/components/net/apps/tcpecho.c b/components/net/apps/tcpecho.c index 4c04bcc813..ac5c8cf273 100644 --- a/components/net/apps/tcpecho.c +++ b/components/net/apps/tcpecho.c @@ -19,15 +19,15 @@ void tcpecho_entry(void *parameter) while(1) { /* Grab new connection. */ - newconn = netconn_accept(conn); + err = netconn_accept(conn, &newconn); /* Process the new connection. */ - if(newconn != NULL) + if(err == ERR_OK) { struct netbuf *buf; void *data; u16_t len; - while((buf = netconn_recv(newconn)) != NULL) + while(netconn_recv(newconn, &buf) == ERR_OK) { do { diff --git a/components/net/apps/udpecho.c b/components/net/apps/udpecho.c index 33fb01c0cc..4bffcb18ad 100644 --- a/components/net/apps/udpecho.c +++ b/components/net/apps/udpecho.c @@ -15,7 +15,7 @@ void udpecho_entry(void *parameter) while(1) { /* received data to buffer */ - buf = netconn_recv(conn); + netconn_recv(conn, &buf); addr = netbuf_fromaddr(buf); port = netbuf_fromport(buf); @@ -24,7 +24,7 @@ void udpecho_entry(void *parameter) netconn_connect(conn, addr, port); /* reset address, and send to client */ - buf->addr = RT_NULL; + buf->addr = *IP_ADDR_ANY; netconn_send(conn, buf); /* release buffer */