[Note: This page does not describe the callback or zero copy interfaces,
which are available for expert users.]
FreeRTOS+TCP is still in the lab
FreeRTOS+TCP is already used in
commercial products and we encourage
you to try it yourself.
Be aware however that we are
still refining its design, and the
source code and documentation do not
yet meet Real Time Engineers Ltd's strict quality standards.
Please use the forum for support,
feedback and ideas,
or contact us directly if you have a specific business interest.
is used to receive data from a TCP socket.
FreeRTOS_recv() cannot be
called until the TCP socket has been created, configured, bound
and connected to a remote socket.
The source code below demonstrates how to use FreeRTOS_recv() to place
received data into a buffer. In the example it is assumed that the
socket has already been created and connected.
#define BUFFER_SIZE 512
static void prvEchoClientRxTask( void *pvParameters )
static char cRxedData[ BUFFER_SIZE ];
xSocket = ( Socket_t ) pvParameters;
for( ;; )
lBytesReceived = FreeRTOS_recv( xSocket, &cRxedData, BUFFER_SIZE, 0 );
if( lBytesReceived > 0 )
prvPorcessData( cRxedData, lBytesReceived );
else if( lBytesReceived == 0 )
FreeRTOS_shutdown( xSocket, FREERTOS_SHUT_RDWR );
while( FreeRTOS_recv( xSocket, pcBufferToTransmit, xTotalLengthToSend, 0 ) >= 0 )
vTaskDelay( pdTICKS_TO_MS( 250 ) );
FreeRTOS_closesocket( xSocket );
xTaskDelete( NULL );
Example using FreeRTOS_recv()
Back to the RTOS TCP networking tutorial index