If the receive was successful then the number of bytes received (placed in the buffer pointed to by pvBuffer) is returned.
If a time out occurred before data could be received then 0 is returned.
If there was not enough memory for the socket to be able to create either an Rx or Tx stream then -pdFREERTOS_ERRNO_ENOMEM is returned.
If the socket was closed or got closed then -pdFREERTOS_ERRNO_ENOTCONN is returned.
If the socket received a signal, causing the read operation to be aborted, then -pdFREERTOS_ERRNO_EINTR is returned.
If the socket is not valid, is not a TCP socket, or is not bound then -pdFREERTOS_ERRNO_EINVAL is returned;
Note that, because FreeRTOS does not implement errno, the behaviour in the presence of an error is necessarily different to that of recv() functions that are fully compliant with the expected Berkeley sockets behaviour.
See the "Creating, Configuring and Binding TCP Client and Server Sockets" section of the FreeRTOS+TCP networking tutorial pages for examples of how to prepare a TCP socket for receiving data.
See the "Receiving TCP Data" section of the FreeRTOS+TCP networking tutorial pages for examples of receiving data from a TCP socket.
[ 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.