From e45ede49b56888b82184f5c7b1dabbfb592603a9 Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Thu, 7 Feb 2019 11:02:57 +0100 Subject: [PATCH] Problem: regression introduced by 68d520e, changing behaviour of unblocking sockets Solution: move unblock call to original location --- src/socks_connecter.cpp | 3 +++ src/tcp.cpp | 3 --- src/tcp_connecter.cpp | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/socks_connecter.cpp b/src/socks_connecter.cpp index a112dbf6..da6cfc24 100644 --- a/src/socks_connecter.cpp +++ b/src/socks_connecter.cpp @@ -232,6 +232,9 @@ int zmq::socks_connecter_t::connect_to_proxy () } zmq_assert (_addr->resolved.tcp_addr != NULL); + // Set the socket to non-blocking mode so that we get async connect(). + unblock_socket (_s); + const tcp_address_t *const tcp_addr = _addr->resolved.tcp_addr; int rc; diff --git a/src/tcp.cpp b/src/tcp.cpp index d9ac7eec..1592f51f 100644 --- a/src/tcp.cpp +++ b/src/tcp.cpp @@ -429,9 +429,6 @@ zmq::fd_t zmq::tcp_open_socket (const char *address_, if (!options_.bound_device.empty ()) bind_to_device (s, options_.bound_device); - // Set the socket to non-blocking mode so that we get async connect(). - unblock_socket (s); - // Set the socket buffer limits for the underlying socket. if (options_.sndbuf >= 0) set_tcp_send_buffer (s, options_.sndbuf); diff --git a/src/tcp_connecter.cpp b/src/tcp_connecter.cpp index 1ddee544..76ff9181 100644 --- a/src/tcp_connecter.cpp +++ b/src/tcp_connecter.cpp @@ -182,6 +182,9 @@ int zmq::tcp_connecter_t::open () } zmq_assert (_addr->resolved.tcp_addr != NULL); + // Set the socket to non-blocking mode so that we get async connect(). + unblock_socket (_s); + const tcp_address_t *const tcp_addr = _addr->resolved.tcp_addr; int rc;