[FreeRTOS+TCP API Reference]
BaseType_t FreeRTOS_getremoteaddress( Socket_t xSocket, struct freertos_sockaddr *pxAddress );
Returns the remote IP address and port of a connected TCP socket.
The socket being queried.
A freertos_sockaddr structure in which the remote address
details are returned.
If the socket referenced by the xSocket parameter is not a TCP socket then -pdFREERTOS_ERRNO_EINVAL is returned.
In all other cases sizeof( freertos_sockaddr ) is returned, and pxAddress->sin_addr will be set to the IP address of the remote connected socket, and pxAddress->sin_port will be set to the TCP port number of the remote connected socket.