#endif
if ((type == ECORE_CON_REMOTE_TCP) ||
- (type == ECORE_CON_REMOTE_NODELAY))
+ (type == ECORE_CON_REMOTE_NODELAY) ||
+ (type == ECORE_CON_REMOTE_CORK))
{
/* TCP */
if (!ecore_con_info_tcp_listen(svr, _ecore_con_cb_tcp_listen,
if (((type == ECORE_CON_REMOTE_TCP) ||
(type == ECORE_CON_REMOTE_NODELAY) ||
+ (type == ECORE_CON_REMOTE_CORK) ||
(type == ECORE_CON_REMOTE_UDP) ||
(type == ECORE_CON_REMOTE_BROADCAST)) &&
(port < 0))
#endif
if ((type == ECORE_CON_REMOTE_TCP) ||
- (type == ECORE_CON_REMOTE_NODELAY))
+ (type == ECORE_CON_REMOTE_NODELAY) ||
+ (type == ECORE_CON_REMOTE_CORK))
{
/* TCP */
if (!ecore_con_info_tcp_connect(svr, _ecore_con_cb_tcp_connect,
{
svr->buf = eina_binbuf_new();
EINA_SAFETY_ON_NULL_RETURN_VAL(svr->buf, 0);
+#ifdef TCP_CORK
+ if ((svr->fd >= 0) && ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK))
+ {
+ int state = 1;
+ if (setsockopt(svr->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
+ /* realistically this isn't anything serious so we can just log and continue */
+ ERR("corking failed! %s", strerror(errno));
+ }
+#endif
}
eina_binbuf_append_length(svr->buf, data, size);
{
cl->buf = eina_binbuf_new();
EINA_SAFETY_ON_NULL_RETURN_VAL(cl->buf, 0);
+#ifdef TCP_CORK
+ if ((cl->fd >= 0) && ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK))
+ {
+ int state = 1;
+ if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
+ /* realistically this isn't anything serious so we can just log and continue */
+ ERR("corking failed! %s", strerror(errno));
+ }
+#endif
}
eina_binbuf_append_length(cl->buf, data, size);
svr->write_buf_offset = 0;
eina_binbuf_free(svr->buf);
svr->buf = NULL;
+#ifdef TCP_CORK
+ if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK)
+ {
+ int state = 0;
+ if (setsockopt(svr->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
+ /* realistically this isn't anything serious so we can just log and continue */
+ ERR("uncorking failed! %s", strerror(errno));
+ }
+#endif
}
if (svr->fd_handler)
cl->buf_offset = 0;
eina_binbuf_free(cl->buf);
cl->buf = NULL;
+#ifdef TCP_CORK
+ if ((cl->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_CORK)
+ {
+ int state = 0;
+ if (setsockopt(cl->fd, IPPROTO_TCP, TCP_CORK, (char *)&state, sizeof(int)) < 0)
+ /* realistically this isn't anything serious so we can just log and continue */
+ ERR("uncorking failed! %s", strerror(errno));
+ }
+#endif
if (cl->fd_handler)
ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ);
}