From f01fa48eec540f03c427f9ffc31efc6e18d17838 Mon Sep 17 00:00:00 2001 From: christiaans Date: Tue, 28 Feb 2006 08:23:22 +0000 Subject: [PATCH] Removed tabs, added netconn_close(). --- ports/unix/proj/unixsim/apps/tcpecho.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ports/unix/proj/unixsim/apps/tcpecho.c b/ports/unix/proj/unixsim/apps/tcpecho.c index 2e683d5..2ad1959 100644 --- a/ports/unix/proj/unixsim/apps/tcpecho.c +++ b/ports/unix/proj/unixsim/apps/tcpecho.c @@ -60,18 +60,21 @@ tcpecho_thread(void *arg) u16_t len; while ((buf = netconn_recv(newconn)) != NULL) { - /*printf("Recved\n");*/ - do { - netbuf_data(buf, &data, &len); - err = netconn_write(newconn, data, len, NETCONN_COPY); - if (err != ERR_OK) { - /* printf("tcpecho: netconn_write: error \"%s\"\n", lwip_strerr(err));*/ - } - } while (netbuf_next(buf) >= 0); - netbuf_delete(buf); + /*printf("Recved\n");*/ + do { + netbuf_data(buf, &data, &len); + err = netconn_write(newconn, data, len, NETCONN_COPY); +#if 0 + if (err != ERR_OK) { + printf("tcpecho: netconn_write: error \"%s\"\n", lwip_strerr(err)); + } +#endif + } while (netbuf_next(buf) >= 0); + netbuf_delete(buf); } - /*printf("Got EOF, looping\n");*/ + /*printf("Got EOF, looping\n");*/ /* Close connection and discard connection identifier. */ + netconn_close(newconn); netconn_delete(newconn); } }