Commit a1ace326 authored by Jacques Germishuys's avatar Jacques Germishuys

Problem: TCP_NODELAY is set prior to connecting, which is problematic on Windows

Solution: Set TCP_NODELAY after connect()

Reference: https://mail.openvswitch.org/pipermail/ovs-dev/2014-October/290251.html
parent cfbbfb8a
......@@ -436,9 +436,6 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
*w_ = open_socket (AF_INET, SOCK_STREAM, 0);
wsa_assert (*w_ != INVALID_SOCKET);
// Set TCP_NODELAY on writer socket.
tune_socket (*w_);
if (sync != NULL) {
// Enter the critical section.
DWORD dwrc = WaitForSingleObject (sync, INFINITE);
......@@ -465,6 +462,9 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
rc = connect (*w_, reinterpret_cast<struct sockaddr *> (&addr),
sizeof addr);
// Set TCP_NODELAY on writer socket.
tune_socket (*w_);
// Accept connection from writer.
if (rc != SOCKET_ERROR)
*r_ = accept (listener, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment