From 7a65f932826220c741ffbf5698b48692a787d915 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 9 Sep 2007 17:20:56 +0000 Subject: Implement TCP send; remove uIP proto-sockets git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@339 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/net/sendto.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'nuttx/net/sendto.c') diff --git a/nuttx/net/sendto.c b/nuttx/net/sendto.c index eef1a31b4..bba9c5b47 100644 --- a/nuttx/net/sendto.c +++ b/nuttx/net/sendto.c @@ -97,7 +97,7 @@ void sendto_interrupt(void *private) * * Description: * If sendto() is used on a connection-mode (SOCK_STREAM, SOCK_SEQPACKET) - * socket, the parameters to and tolen are ignored (and the error EISCONN + * socket, the parameters to and 'tolen' are ignored (and the error EISCONN * may be returned when they are not NULL and 0), and the error ENOTCONN is * returned when the socket was not actually connected. * @@ -214,6 +214,10 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, /* Perform the UDP sendto operation */ #ifdef CONFIG_NET_UDP + /* Set the socket state to sending */ + + psock->s_flags = _SS_SETSTATE(psock->s_flags, _SF_SEND); + /* Initialize the state structure. This is done with interrupts * disabled because we don't want anything to happen until we * are ready. @@ -244,6 +248,10 @@ ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, sem_wait(&state.st_sem); sem_destroy(&state.st_sem); + + /* Set the socket state to idle */ + + psock->s_flags = _SS_SETSTATE(psock->s_flags, _SF_IDLE); return len; #else err = ENOSYS; -- cgit v1.2.3