I understood that both of them disable Nagle\'s algorithm.
When should/ shouldn\'t I use each one of them?
TCP_NODELAY
Used to disable Nagle's algorithm to improve TCP/IP networks and decrease the number of packets by waiting until an acknowledgment of previously sent data is received to send the accumulated packets.
//From the tcp(7) manual:
TCP_CORK (or TCP_NOPUSH in FreeBSD)
If set, don't send out partial frames. All queued partial frames are sent when the option is cleared again. This is useful for prepending headers before calling sendfile(2), or for throughput optimization. As currently implemented, there is a ** 200-millisecond ceiling** on the time for which output is corked by TCP_CORK. If this ceiling is reached, then queued data is automatically transmitted. This option can be combined with TCP_NODELAY only since Linux 2.5.71. This option should not be used in code intended to be portable.