Commit 30243651 authored by Simon Giesecke's avatar Simon Giesecke

Problem: windows socket error number cleared before saved to saved_errno

Solution: call tune_socket only if connect was successful
parent 66d0f351
......@@ -449,20 +449,23 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
}
// Listen for incoming connections.
if (rc != SOCKET_ERROR)
if (rc != SOCKET_ERROR) {
rc = listen (listener, 1);
}
// Connect writer to the listener.
if (rc != SOCKET_ERROR)
if (rc != SOCKET_ERROR) {
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)
if (rc != SOCKET_ERROR) {
// Set TCP_NODELAY on writer socket.
tune_socket (*w_);
*r_ = accept (listener, NULL, NULL);
}
// Send/receive large chunk to work around TCP slow start
// This code is a workaround for #1608
......
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