Sending Data Using a TCP Socket
[Note: This page does not describe the callback or zero copy interfaces,
which are available for expert users.]
Part of the FreeRTOS+TCP Networking Tutorial
After a TCP socket has been created, configured, and bound it can be connected to a remote socket using the FreeRTOS_connect() API function, or it can accept connections from a remote socket. Once connected, data is sent to the remote socket using the FreeRTOS_send() API function.
The source code below shows a function that creates a socket, sends data to the socket, then gracefully shuts down and closes the socket. Note that this socket is not explicitly bound to a port number – causing it to be bound automatically inside the FreeRTOS_connect() API function.