LwIP flush TCP send buffer using Socket API

Hi everyone!

I took over a project that uses FreeRTOS and LwIP, the latter with the Socket API, i.e., lwip_write() (the write() alias actually) is used for sendting data over TCP.

Now I observerd that not all data is sent immediately but is held back by the stack. Since there is the tcp_output() function in the ‘raw’ API, that can be used to force the stack to send all data in the buffer, I wonder if there is a similar function in the Socket API or any other way to either flush the buffer when sending with lwip_send or using the Socket API and raw API concurrently.
I would mean A LOT of extra work for me to migrate from the Socket API to the raw API but is crucial for the application to get all data at once.

The should be a socket option to disable Nagle algorithm (often it’s the TCP_NODELAY sockoption).