mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-26 02:18:06 +01:00
Problem: process_term and close duplicated across subclasses of stream_connecter_base_t
Solution: pull up
This commit is contained in:
@@ -87,19 +87,7 @@ void zmq::tcp_connecter_t::process_term (int linger_)
|
||||
_connect_timer_started = false;
|
||||
}
|
||||
|
||||
if (_reconnect_timer_started) {
|
||||
cancel_timer (reconnect_timer_id);
|
||||
_reconnect_timer_started = false;
|
||||
}
|
||||
|
||||
if (_handle) {
|
||||
rm_handle ();
|
||||
}
|
||||
|
||||
if (_s != retired_fd)
|
||||
close ();
|
||||
|
||||
own_t::process_term (linger_);
|
||||
stream_connecter_base_t::process_term (linger_);
|
||||
}
|
||||
|
||||
void zmq::tcp_connecter_t::in_event ()
|
||||
@@ -373,17 +361,3 @@ bool zmq::tcp_connecter_t::tune_socket (const fd_t fd_)
|
||||
| tune_tcp_maxrt (fd_, options.tcp_maxrt);
|
||||
return rc == 0;
|
||||
}
|
||||
|
||||
void zmq::tcp_connecter_t::close ()
|
||||
{
|
||||
zmq_assert (_s != retired_fd);
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
const int rc = closesocket (_s);
|
||||
wsa_assert (rc != SOCKET_ERROR);
|
||||
#else
|
||||
const int rc = ::close (_s);
|
||||
errno_assert (rc == 0);
|
||||
#endif
|
||||
_socket->event_closed (_endpoint, _s);
|
||||
_s = retired_fd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user