summaryrefslogtreecommitdiff
path: root/apps/examples/poll/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/poll/host.c')
-rw-r--r--apps/examples/poll/host.c9
1 files changed, 7 insertions, 2 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);