summaryrefslogtreecommitdiff
path: root/nuttx/net/accept.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-08-02 23:35:27 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-08-02 23:35:27 +0000
commit1169a1c394fac06c2c922cdd65afd9b00ce5afce (patch)
tree4f8aba554a72c335c47fda18723012ad492daa0c /nuttx/net/accept.c
parent287259e702344f08c101996a47349e049bc7af27 (diff)
downloadpx4-nuttx-1169a1c394fac06c2c922cdd65afd9b00ce5afce.tar.gz
px4-nuttx-1169a1c394fac06c2c922cdd65afd9b00ce5afce.tar.bz2
px4-nuttx-1169a1c394fac06c2c922cdd65afd9b00ce5afce.zip
accept() now supports non-blocking operations
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2011 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net/accept.c')
-rw-r--r--nuttx/net/accept.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/net/accept.c b/nuttx/net/accept.c
index 81ac8dbff..28ea7e237 100644
--- a/nuttx/net/accept.c
+++ b/nuttx/net/accept.c
@@ -356,6 +356,18 @@ int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
nvdbg("Pending conn=%p\n", state.acpt_newconn);
accept_tcpsender(state.acpt_newconn, inaddr);
}
+
+ /* In general, this uIP-based implementation will not support non-blocking
+ * socket operations... except in a few cases: Here for TCP accept with backlog
+ * enabled. If this socket is configured as non-blocking then return EAGAIN
+ * if there is no pending connection in the backlog.
+ */
+
+ else if (_SS_ISNONBLOCK(psock->s_flags))
+ {
+ err = EAGAIN;
+ goto errout_with_irq;
+ }
else
#endif
{