Separate net/net_send_buffered.c and net/net_send_unbuffered.c to net/tcp/tcp_send_buffered.c, net/tcp/tcp_send_unbuffered.c, and pkt/pkt_send.c

This commit is contained in:
Gregory Nutt
2014-06-24 08:03:44 -06:00
parent 9022bc63cf
commit 38c6e41e8e
9 changed files with 692 additions and 309 deletions
+10
View File
@@ -39,6 +39,16 @@ ifeq ($(CONFIG_NET),y)
ifeq ($(CONFIG_NET_TCP),y)
# Socket layer
ifeq ($(CONFIG_NET_TCP_WRITE_BUFFERS),y)
SOCK_CSRCS += tcp_send_buffered.c
else
SOCK_CSRCS += tcp_send_unbuffered.c
endif
# Transport layer
NET_CSRCS += tcp_conn.c tcp_seqno.c tcp_poll.c tcp_timer.c tcp_send.c
NET_CSRCS += tcp_input.c tcp_appsend.c tcp_listen.c tcp_callback.c
NET_CSRCS += tcp_backlog.c
+62
View File
@@ -42,6 +42,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
#ifdef CONFIG_NET_TCP
/****************************************************************************
@@ -68,6 +70,66 @@ extern "C"
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Function: tcp_send
*
* Description:
* The tcp_send() call may be used only when the TCP socket is in a
* connected state (so that the intended recipient is known).
*
* Parameters:
* psock An instance of the internal socket structure.
* buf Data to send
* len Length of data to send
*
* Returned Value:
* On success, returns the number of characters sent. On error,
* -1 is returned, and errno is set appropriately:
*
* EAGAIN or EWOULDBLOCK
* The socket is marked non-blocking and the requested operation
* would block.
* EBADF
* An invalid descriptor was specified.
* ECONNRESET
* Connection reset by peer.
* EDESTADDRREQ
* The socket is not connection-mode, and no peer address is set.
* EFAULT
* An invalid user space address was specified for a parameter.
* EINTR
* A signal occurred before any data was transmitted.
* EINVAL
* Invalid argument passed.
* EISCONN
* The connection-mode socket was connected already but a recipient
* was specified. (Now either this error is returned, or the recipient
* specification is ignored.)
* EMSGSIZE
* The socket type requires that message be sent atomically, and the
* size of the message to be sent made this impossible.
* ENOBUFS
* The output queue for a network interface was full. This generally
* indicates that the interface has stopped sending, but may be
* caused by transient congestion.
* ENOMEM
* No memory available.
* ENOTCONN
* The socket is not connected, and no target has been given.
* ENOTSOCK
* The argument s is not a socket.
* EPIPE
* The local end has been shut down on a connection oriented socket.
* In this case the process will also receive a SIGPIPE unless
* MSG_NOSIGNAL is set.
*
* Assumptions:
*
****************************************************************************/
struct socket;
ssize_t tcp_send(FAR struct socket *psock, FAR const void *buf, size_t len);
/****************************************************************************
* Function: tcp_wrbuffer_initialize
*
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff