Keep alive understanding

The server doesn’t have to do a shutdown at all. The client has a request, and when it is ready, it will start a closure of the connection.
All the server has to do is keep on reading ( FreeRTOS_recv() ) from the socket until it returns an error.
Can you try that?