#include <boost/optional.hpp>
#include <poll.h>
#include <iomanip>
+#include <netinet/tcp.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
return true; // we pretend this happened.
}
+void setTCPNoDelay(int sock)
+{
+ int flag = 1;
+ setsockopt(sock, /* socket affected */
+ IPPROTO_TCP, /* set option at TCP level */
+ TCP_NODELAY, /* name of option */
+ (char *) &flag, /* the cast is historical cruft */
+ sizeof(flag)); /* length of option value */
+}
+
+
bool setNonBlocking(int sock)
{
int flags=fcntl(sock,F_GETFL,0);
//! Sets the socket into non-blocking mode.
bool setNonBlocking( int sock );
+void setTCPNoDelay(int sock);
bool isNonBlocking(int sock);
int closesocket(int fd);
bool setCloseOnExec(int sock);