Download FreeRTOS
 

Quality RTOS & Embedded Software

LIBRARIES
WHAT'S NEW
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.
OPC-UA over TSN with FreeRTOS.

Network Sockets

A socket is conceptually an end point for communication, and the Berkeley sockets API is the defacto cross platform standard API used to create, configure, read from, write to, and otherwise manage sockets.

A socket is identified using the IP address of the network node, and the port number within the network node.

If a network node wants to send UDP data onto the network it first creates a socket, then sends the data to that socket. If a network node wants to receive UDP data it first creates a socket on an address that is known by the node that will send the data, then reads the data from that socket.

If a network node wants to send TCP data onto the network it first creates a socket, connects that socket to a socket on a remote node, then sends the data to that socket. If a network node wants to receive TCP data it first creates a socket, then listens on that socket for incoming connections. When a connection is received it may (optionally) create a new socket to handle the connection and then receive the data on the new socket - leaving the original socket listening for additional incoming connections.

It can be seen then that any one network node can be involved in multiple network conversations simultaneously - with a socket being used at each end of each unique conversation.

Sockets can also be used to send and receive broadcast and multicast communications - which are both a form of one to many communications.

The API function FreeRTOS_socket() is used to create a socket.

The FreeRTOS-Plus-TCP networking tutorial demonstrates how to use sockets.

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.