Implements basic TCP connection logic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@326 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2007-09-02 21:58:35 +00:00
parent 7015014104
commit f47c8cb529
25 changed files with 1426 additions and 625 deletions
+13 -3
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* socket.c
* net/socket.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -129,15 +129,25 @@ int socket(int domain, int type, int protocol)
/* Initialize the socket structure */
#ifdef CONFIG_NET_UDP
psock = sockfd_socket(sockfd);
if (psock)
{
/* Save the protocol type */
psock->s_type = type;
/* Allocate a TCP connection structure */
psock->s_conn = uip_tcpalloc();
if (!psock->s_conn)
{
/* Failed to reserve a connection structure */
sockfd_release(sockfd);
err = ENFILE;
goto errout;
}
}
#endif
return sockfd;