mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 13:21:10 +01:00
Problem: code duplication in get_address of ipc/tcp/tipc listener classes
Solution: pull up to base class
This commit is contained in:
committed by
Simon Giesecke
parent
5c81bbe82e
commit
9a376fbe24
@@ -91,18 +91,9 @@ void zmq::tcp_listener_t::in_event ()
|
||||
create_engine (fd);
|
||||
}
|
||||
|
||||
int zmq::tcp_listener_t::get_address (std::string &addr_)
|
||||
std::string zmq::tcp_listener_t::get_socket_name (zmq::fd_t fd_) const
|
||||
{
|
||||
// Get the details of the TCP socket
|
||||
struct sockaddr_storage ss;
|
||||
const zmq_socklen_t sl = get_socket_address (&ss);
|
||||
if (!sl) {
|
||||
addr_.clear ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
tcp_address_t addr (reinterpret_cast<struct sockaddr *> (&ss), sl);
|
||||
return addr.to_string (addr_);
|
||||
return stream_listener_base_t::get_socket_name<tcp_address_t> (fd_);
|
||||
}
|
||||
|
||||
int zmq::tcp_listener_t::set_address (const char *addr_)
|
||||
|
||||
Reference in New Issue
Block a user