This disables the TCP Nagle algorithm.
#endif
}
+int net_set_tcp_nodelay(int fd, bool nodelay)
+{
+ int val = nodelay;
+
+ return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val));
+}
+
int net_set_send_buffer_size(int fd, size_t size)
{
int opt;
/* Set TCP_CORK if supported, ie. don't send out partial frames.
Returns 0 if ok, -1 if failed. */
int net_set_cork(int fd, bool cork) ATTR_NOWARN_UNUSED_RESULT;
+/* Set TCP_NODELAY, which disables the Nagle algorithm. */
+int net_set_tcp_nodelay(int fd, bool nodelay);
/* Set socket kernel buffer sizes */
int net_set_send_buffer_size(int fd, size_t size);