summaryrefslogtreecommitdiff
path: root/apps/examples/poll
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/poll
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/poll')
-rw-r--r--apps/examples/poll/host.c9
-rw-r--r--apps/examples/poll/net_listener.c4
-rw-r--r--apps/examples/poll/net_reader.c4
3 files changed, 11 insertions, 6 deletions
diff --git a/apps/examples/poll/host.c b/apps/examples/poll/host.c
index 47f2c3e53..302cceb0f 100644
--- a/apps/examples/poll/host.c
+++ b/apps/examples/poll/host.c
@@ -1,8 +1,8 @@
/****************************************************************************
* examples/poll/host.c
*
- * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -137,6 +137,11 @@ int main(int argc, char **argv, char **envp)
message("client: recv failed: %d\n", errno);
goto errout_with_socket;
}
+ else if (nbytesrecvd == 0)
+ {
+ message("client: The server broke the connections\n");
+ goto errout_with_socket;
+ }
inbuf[nbytesrecvd] = '\0';
message("client: Received '%s' (%d bytes)\n", inbuf, nbytesrecvd);
diff --git a/apps/examples/poll/net_listener.c b/apps/examples/poll/net_listener.c
index 4d425c608..4bde567fb 100644
--- a/apps/examples/poll/net_listener.c
+++ b/apps/examples/poll/net_listener.c
@@ -1,8 +1,8 @@
/****************************************************************************
* examples/poll/net_listener.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/apps/examples/poll/net_reader.c b/apps/examples/poll/net_reader.c
index b0cf94316..ea0accc8d 100644
--- a/apps/examples/poll/net_reader.c
+++ b/apps/examples/poll/net_reader.c
@@ -1,8 +1,8 @@
/****************************************************************************
* examples/poll/net_reader.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions