From 25ad91e04f9183c4120d558b5c159316a38e7cda Mon Sep 17 00:00:00 2001 From: David Lin Date: Fri, 14 Feb 2020 22:23:26 +0800 Subject: [PATCH] Minor optimisation to the tcp_server code This is minor optimisation to the tcp_server code: Note that two lines, one is 'recv(%d) msg from client', the other is 'send mes error', the second 'mes' should be 'msg', for short. The code is more readable. --- examples/tcp_udp_base_lwip/tcp_server/tcp_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tcp_udp_base_lwip/tcp_server/tcp_server.c b/examples/tcp_udp_base_lwip/tcp_server/tcp_server.c index 8a399cba..a215d600 100644 --- a/examples/tcp_udp_base_lwip/tcp_server/tcp_server.c +++ b/examples/tcp_udp_base_lwip/tcp_server/tcp_server.c @@ -51,7 +51,7 @@ void application_entry(void *arg) buff[n] = '\0'; printf("recv(%d) msg from client:%s\n", ++cnt, buff); if ((send(connfd, buff, strlen(buff), 0)) < 0) { - printf("send mes error: %s errno : %d\n", strerror(errno), errno); + printf("send msg error: %s errno : %d\n", strerror(errno), errno); break; } close(connfd);