The net_flush function flushes any buffered data. If you require that data be sent immediately, call net_flush after calling network output functions such as net_write or net_sendfile.
int net_flush(SYS_NETFD sd);
0 on success, or a negative value if an error occurred.
SYS_NETFD sd is the socket to flush.
net_write(sn->csd, "Please wait... ", 15); net_flush(sn->csd); /* Perform some time-intensive operation */ ... net_write(sn->csd, "Thank you.\\n", 11);