# include <config.h>
#endif
+#include <sys/types.h>
#include <sys/stat.h>
#include <arpa/inet.h>
+#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <errno.h>
if (!svr->fd_handler) goto error;
}
- if (type == ECORE_CON_REMOTE_TCP)
+ if (type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_NODELAY)
{
/* TCP */
if (!ecore_con_info_tcp_listen(svr, _ecore_con_cb_tcp_listen, svr)) goto error;
type = compl_type & ECORE_CON_TYPE;
- if ((type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_UDP || ECORE_CON_REMOTE_BROADCAST) && (port < 0)) return NULL;
+ if ((type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_NODELAY
+ || type == ECORE_CON_REMOTE_UDP || ECORE_CON_REMOTE_BROADCAST) && (port < 0)) return NULL;
if ((type == ECORE_CON_LOCAL_USER) || (type == ECORE_CON_LOCAL_SYSTEM) ||
(type == ECORE_CON_LOCAL_ABSTRACT))
}
}
- if (type == ECORE_CON_REMOTE_TCP)
+ if (type == ECORE_CON_REMOTE_TCP || type == ECORE_CON_REMOTE_NODELAY)
{
/* TCP */
if (!ecore_con_info_tcp_connect(svr, _ecore_con_cb_tcp_connect, svr)) goto error;
lin.l_onoff = 1;
lin.l_linger = 0;
if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) < 0) goto error;
+ if (svr->type == ECORE_CON_REMOTE_NODELAY)
+ {
+ int flag = 1;
+
+ if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) < 0)
+ goto error;
+ }
if (bind(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0) goto error;
if (listen(svr->fd, 4096) < 0) goto error;
svr->fd_handler =
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) goto error;
if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0)
goto error;
+ if (svr->type == ECORE_CON_REMOTE_NODELAY)
+ {
+ int flag = 1;
+
+ if (setsockopt(svr->fd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) < 0)
+ goto error;
+ }
if (connect(svr->fd, net_info->info.ai_addr, net_info->info.ai_addrlen) < 0)
{
if (errno != EINPROGRESS)