summaryrefslogtreecommitdiff
path: root/apps/examples/nettest/nettest_client.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-18 18:13:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-18 18:13:30 +0000
commitfadbb925a6a118790d8d661fea3956bb0f76348a (patch)
treeca4c58d32d12949e8d08cb69a652b5e3f7fd0e58 /apps/examples/nettest/nettest_client.c
parent376af5201c555ee163045a8103d8e592f9a1b1bc (diff)
downloadnuttx-fadbb925a6a118790d8d661fea3956bb0f76348a.tar.gz
nuttx-fadbb925a6a118790d8d661fea3956bb0f76348a.tar.bz2
nuttx-fadbb925a6a118790d8d661fea3956bb0f76348a.zip
Correct and error in recv() and recvfrom() return value
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4402 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/nettest/nettest_client.c')
-rw-r--r--apps/examples/nettest/nettest_client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/examples/nettest/nettest_client.c b/apps/examples/nettest/nettest_client.c
index 5f95d7b70..d498feb31 100644
--- a/apps/examples/nettest/nettest_client.c
+++ b/apps/examples/nettest/nettest_client.c
@@ -1,7 +1,7 @@
/****************************************************************************
* examples/nettest/nettest-client.c
*
- * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -169,6 +169,11 @@ void send_client(void)
message("client: recv failed: %d\n", errno);
goto errout_with_socket;
}
+ else if (nbytesrecvd == 0)
+ {
+ message("client: The server closed the connection\n");
+ goto errout_with_socket;
+ }
totalbytesrecvd += nbytesrecvd;
message("client: Received %d of %d bytes\n", totalbytesrecvd, SENDSIZE);
}