#include <forb/config.h>
#include "discovery.h"
#include <stdlib.h>
+#include <netinet/tcp.h>
#include "iop.h" /* FIXME: Sending hello should be handled in IOP layer */
/**
return ret;
}
-int setnonblocking(int fd);
+static int
+setnonblocking(int fd);
+
+static int
+setnodelay(int fd)
+{
+ int ret = 0;
+#if 0 /* For nice graphs in benchmarks */
+ int yes = 1;
+ ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes));
+ if (ret < 0) {
+ ul_logerr("setsockopt(TCP_NODELAY): %s\n", strerror(errno));
+ }
+#endif
+ return ret;
+
+}
static int
inet_connect(forb_peer_t *peer)
}
setnonblocking(ipeer->socket);
+ setnodelay(ipeer->socket);
struct epoll_event ev;
struct inet_port *p = peer->port->desc.proto_priv;
close(client);
return -1;
}
+ setnodelay(client);
peer = forb_peer_new();
if (peer) {