Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Updated Apr 2025

FreeRTOS_recvcount()

[FreeRTOS-Plus-TCP API Reference]

FreeRTOS_sockets.h

1BaseType_t FreeRTOS_recvcount( Socket_t xSocket );

Returns the number of bytes in a TCP socket's Rx stream that are yet to be read.

Parameters:

  • xSocket

    The socket being queried.

Returns:

  • If the socket referenced by the xSocket parameter is not a TCP socket then -pdFREERTOS_ERRNO_EINVAL is returned.

  • If the socket referenced by the xSocket parameter does not yet have an Rx stream then 0 is returned (the Rx stream is not created until it is required).

  • In all other cases the returned value is the number of bytes that remain in the socket's Rx stream.