TCP (Transmission Control Protocol) More...
Go to the source code of this file.
|TCP related initialization. More...|
|Get an ephemeral port number. More...|
|error_t||tcpConnect (Socket *socket, const IpAddr *remoteIpAddr, uint16_t remotePort)|
|Establish a TCP connection. More...|
|error_t||tcpListen (Socket *socket, uint_t backlog)|
|Place a socket in the listening state. More...|
|Socket *||tcpAccept (Socket *socket, IpAddr *clientIpAddr, uint16_t *clientPort)|
|Permit an incoming connection attempt on a TCP socket. More...|
|error_t||tcpSend (Socket *socket, const uint8_t *data, size_t length, size_t *written, uint_t flags)|
|Send data to a connected socket. More...|
|error_t||tcpReceive (Socket *socket, uint8_t *data, size_t size, size_t *received, uint_t flags)|
|Receive data from a connected socket. More...|
|error_t||tcpShutdown (Socket *socket, uint_t how)|
|Shutdown gracefully reception, transmission, or both. More...|
|error_t||tcpAbort (Socket *socket)|
|Abort an existing TCP connection. More...|
|TcpState||tcpGetState (Socket *socket)|
|Get the current state of the TCP FSM. More...|
|Socket *||tcpKillOldestConnection (void)|
|Kill the oldest socket in the TIME-WAIT state. More...|
TCP (Transmission Control Protocol)
Copyright (C) 2010-2023 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Definition in file tcp.c.
Macro Definition Documentation
Permit an incoming connection attempt on a TCP socket.
[in] socket Handle to a socket previously placed in a listening state [out] clientIpAddr IP address of the client [out] clientPort Port number used by the client
- Handle to the socket in which the actual connection is made
Place a socket in the listening state.
Place a socket in a state in which it is listening for an incoming connection
[in] socket Socket to place in the listening state [in] backlog backlog The maximum length of the pending connection queue. If this parameter is zero, then the default backlog value is used instead
- Error code
|error_t tcpReceive||(||Socket *||socket,|
Receive data from a connected socket.
[in] socket Handle that identifies a connected socket [out] data Buffer where to store the incoming data [in] size Maximum number of bytes that can be received [out] received Number of bytes that have been received [in] flags Set of flags that influences the behavior of this function
- Error code
|error_t tcpSend||(||Socket *||socket,|
|const uint8_t *||data,|
Send data to a connected socket.
[in] socket Handle that identifies a connected socket [in] data Pointer to a buffer containing the data to be transmitted [in] length Number of bytes to be transmitted [out] written Actual number of bytes written (optional parameter) [in] flags Set of flags that influences the behavior of this function
- Error code
Shutdown gracefully reception, transmission, or both.
Note that socketShutdown() does not close the socket, and resources attached to the socket will not be freed until socketClose() is invoked
[in] socket Handle to a socket [in] how Flag that describes what types of operation will no longer be allowed
- Error code