From 601e00376be887712b2443347032cfa80119ccd8 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 1 Oct 2020 14:54:30 +0300 Subject: [PATCH] samples: sockets: dumb_http_server: If send() fails, print errno Helps with debugging TCP stack issues. Signed-off-by: Paul Sokolovsky --- samples/net/sockets/dumb_http_server/src/socket_dumb_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/net/sockets/dumb_http_server/src/socket_dumb_http.c b/samples/net/sockets/dumb_http_server/src/socket_dumb_http.c index 62177e94111..a6f16946872 100644 --- a/samples/net/sockets/dumb_http_server/src/socket_dumb_http.c +++ b/samples/net/sockets/dumb_http_server/src/socket_dumb_http.c @@ -119,7 +119,7 @@ void main(void) int sent_len = send(client, data, len, 0); if (sent_len == -1) { - printf("Error sending data to peer\n"); + printf("Error sending data to peer, errno: %d\n", errno); break; } data += sent_len;