Real time embedded FreeRTOS RSS feed 
Homepage FreeRTOS+ Products FreeRTOS Labs Support Forum Contact / Enquiries

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 is 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+TCP networking tutorial demonstrates how to use sockets.


Useful links:


Other networking basics pages:



[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ FreeRTOS Labs Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]




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