mirror of
https://github.com/zeromq/libzmq.git
synced 2025-09-26 15:59:34 +02:00
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
This commit is contained in:
parent
cfbbfb8ab8
commit
a1ace32650
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user