return true; // we pretend this happened.
}
-void setTCPNoDelay(int sock)
+bool 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 */
+ return 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)) == 0; /* length of option value */
}
//! Sets the socket into non-blocking mode.
bool setNonBlocking( int sock );
-void setTCPNoDelay(int sock);
+bool setTCPNoDelay(int sock);
bool isNonBlocking(int sock);
int closesocket(int fd);
bool setCloseOnExec(int sock);