diff --git a/src/ctx.cpp b/src/ctx.cpp index 176d3595..9c77a6e6 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -445,6 +445,14 @@ void zmq::ctx_t::connect_inproc_sockets (zmq::socket_base_t *bind_socket_, bind_socket_->inc_seqnum(); pending_connection_.bind_pipe->set_tid(bind_socket_->get_tid()); + if (!bind_options.recv_identity) { + msg_t msg; + const bool ok = pending_connection_.bind_pipe->read (&msg); + zmq_assert (ok); + const int rc = msg.close (); + errno_assert (rc == 0); + } + if (side_ == bind_side) { command_t cmd; cmd.type = command_t::bind; @@ -474,14 +482,6 @@ void zmq::ctx_t::connect_inproc_sockets (zmq::socket_base_t *bind_socket_, pending_connection_.connect_pipe->set_hwms(hwms [1], hwms [0]); pending_connection_.bind_pipe->set_hwms(hwms [0], hwms [1]); - if (!bind_options.recv_identity) { - msg_t msg; - const bool ok = pending_connection_.bind_pipe->read (&msg); - zmq_assert (ok); - const int rc = msg.close (); - errno_assert (rc == 0); - } - if (pending_connection_.endpoint.options.recv_identity) { msg_t id; int rc = id.init_size (bind_options.identity_size);